Questions tagged as 'jpa'

0
answers

What is the best way to map entity with JPA composite key?

I have two tables to map to two entities. I need to list it on the screen like this: Id | Produto | Cliente | Razão Social | País | Estado ----------------------------------------------------------------- 1 | TV | 000001 | Jao da Si...
asked by 23.05.2018 / 15:17
0
answers

Could not read entity state from ResultSet EntityKey OneToMany composite keys

I'm having problems in the oneToMany relationship of two entities using Jpa Hibernate. I have two tables, one cancellation and another that has the orders that are part of the cancellation. The cancellation table has a simple primary key (idc...
asked by 02.02.2018 / 17:56
0
answers

Mapping HIbernate Embeddable

Good morning! I have a question regarding the mapping of composite keys. The situation is as follows: I have a class whose primary key is made up of two other classes, but I have a third class that the third key is a compound of the oth...
asked by 09.01.2018 / 12:07
1
answer

RollBack () JPA + Hibernate

I have a problem with persisting multiple information in the same transaction, in case something is wrong, some of the information is stored in the database and rollback() is not executed. Here's an example: try { em = Conn...
asked by 16.01.2018 / 20:18
2
answers

Select join with JPQL

Talk the guys! I'm grating here in my TCC and need some help. I know the problem that I am must be very silly, but I do not have much knowledge. I searched everywhere, JPQL documentation and everything, but I could not solve it. I need to log...
asked by 24.11.2017 / 00:07
1
answer

@PreUpdate with @Transient - EclipseLink

I need an @PreUpdate method to be called when an @Transient attribute is modified. This @Transient will always be modified, so yes @PreUpdate would always have to be called. Since it will always have to be called, I looked for an option similar...
asked by 22.11.2017 / 19:13
0
answers

ManyToMany Hibernate error

Hello, I have a% bidirectional% co_related relationship between the class @ManyToMany and Pessoa , where for these, I have the tables in the database for person, address and the table for the relationship between them, Endereço...
asked by 11.01.2018 / 21:51
2
answers

API method fetches information but does not appear on the front end

I have a method of my API that searches the database @RequestMapping(method = RequestMethod.GET, value = "/entidadesUsuarioPermissao/{id}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Collection<PermissoesPagin...
asked by 24.10.2017 / 13:29
0
answers

Problem in left join JPA - JPQL

   Exception in thread "main" javax.persistence.EntityNotFoundException:   Unable to find CNPJ with id 00001388000307 Reading the documentation, I saw that this exception is thrown when it tries to access (by the getReference method o...
asked by 13.10.2017 / 19:37
0
answers

How to get the count and objects with criteria jpa?

I need to return the collation results and also the number of each item in a query with criteria jpa. public List<Dica> obterDicaPorUsuario(){ final CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); final CriteriaQue...
asked by 13.02.2018 / 17:48