Questions tagged as 'hibernate'

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
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

Configure Relational and Non-Relational databases in the same project with Spring-Data + Hibernate

I'm trying to create a Java application where I need to set up two databases: MongoDB and MySQL. My idea is to use Spring-Data with Hibernate for both banks, but I found only tutorials for setting up Cross-Store between the banks. Is there an...
asked by 08.04.2015 / 00:06
1
answer

Hibernate: Error trying to persist field that maps foreign key

In my current Spring project, I'm facing the following issues when trying to save an entity that references another (with foreign key), with this: @Entity @Table(name="pagina") public class Pagina { @Id @Column(name = "id") @Gener...
asked by 06.08.2014 / 18:35
1
answer

Error org.hibernate.LazyInitializationException how to resolve?

I know this error is derived from trying to fetch some data from the database, when I do not have any open session. But the biggest problem for me is that this error is appearing to me completely random, as I am developing a server that proce...
asked by 17.11.2014 / 15:45
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

Pages of JPA queries

I am changing the code of a query because it will return a lot of data when the database is well populated. I'm paging the query. The problem is that when they implemented it, they did the following: You get a string, and you make all possibl...
asked by 03.02.2014 / 12:25