Questions tagged as 'jpa'

1
answer

Java how to do a native query and return to a DTO list

I am using Spring Hibernate and am trying to do a native query with JOiN returning to a DTO list. I tried using @Query (value="", nativeQuery = true) with a List but it returns the serialized attributes. I also tried with @SqlResultSetMapping in...
asked by 27.07.2015 / 18:33
1
answer

Leakage of connections with Hibernate

My system had sporadic crashes and I discovered that this happened due to processes that opened a connection but, due to some error, they did not close it (connection leak). I solved involving the problematic code in try/catch and forc...
asked by 05.02.2015 / 16:31
2
answers

Extend findAll with custom filters

I'm trying to extend findAll from my JPA repository to make custom filters. I did some research and found some ideas of use with Predicates and related but did not identify something that worked in a practical way. I would like to know if...
asked by 26.05.2015 / 16:16
1
answer

NamedQuery with Collection as Parameter

I'm using JPA NamedQuery to create a DTO. And in my Query I have as condition an IN and as parameter IN has values with white spaces in the middle. (Ex: 9292-929). and these values with whitespace, returns nothing. Only values with no...
asked by 05.01.2015 / 17:50
1
answer

JPA query software

Is there any client (like: pgadmin3, Oracle SQL Developer, Mysql Workbench) to query in JPQL? I have a project that uses jpa, and I need to debug the generated jpql's. I've seen that Squirrel does this, but for HQL.     
asked by 05.05.2014 / 16:47
1
answer

Exception StackOverflowError occurring in @ManyToMany relationship with JPA

I'm having a problem in a @ManyToMany entities relationship. When I try to do a simple query on the entity that contains the @ManyToMany stackOverflow occurs. My rule is simple: My entity ApplicationClientVO can access N WebServiceVO and a We...
asked by 09.06.2014 / 18:40
1
answer

Limit set size with JPA

I'm having trouble finding Google and have not found a solution. I have a note in JPA with a set<> I want to limit the size of objects within set , ie the code below: @OneToMany(mappedBy = "pidAplic", cascade = CascadeT...
asked by 14.04.2014 / 22:11
1
answer

How to store change date / time in DB using Hibernate Envers?

I need to keep a log of all transactions of an entity with Hibernate Envers. I configured persistence.xml as follows: <!-- Configurações do Envers --> <property name="hibernate.ejb.event.post-insert" value="org.hiberna...
asked by 08.04.2014 / 14:52
1
answer

How to do a JPA query with @ManyToMany mappings

Good morning. I am having difficulty performing a query in the database where my Employee entity has 2 mappings @ManyToMany and 1 mapping @ManyToOne. When you perform a query, Employee and Projects data is returned without any major problems....
asked by 22.12.2018 / 14:03
0
answers

Hibernate does not consider field to insert

I have a class Cliente that has composite key: @Entity @Table(name = "Clientes") @IdClass(ClientePK.class) public class Cliente implements Serializable { //@EmbeddedId //private ClientePK clientePK; @Id @Column(name = "...
asked by 24.10.2018 / 16:32