Questions tagged as 'hibernate'

1
answer

Hibernate behind incomplete object (without foreign keys)

I have a jsf + Primefaces + Hibernate application, when I make a query in the database, hibernate returns incomplete objects. This happens for all classes but I will use the class questions as an example: public class Questoes implements jav...
asked by 07.10.2015 / 23:31
1
answer

What's wrong with running Hibernate Query?

I'm running this query in hibernate: manager.createQuery("from Usuario where senha = '" + senha + "' and login = '" + login + "'", Usuario.class).getResultList(); But it is giving an exception that one of the columns does not exist in the D...
asked by 26.09.2015 / 20:36
2
answers

Error org.hibernate.LazyInitializationException

Error when the class handling is filled with the data in the database, if there is no record, I can access my xhtml normally. In the class account I correct with fetch = FetchType.EAGER, but in the class handling this error persists, See the rel...
asked by 03.12.2015 / 20:06
1
answer

SelectOneRadio sending only one value

I am completing a simulation system for my course completion work. However, I have a problem that I still can not solve. I do a filter to select the questions for the user to answer, and I play those questions that were found by the filter wi...
asked by 17.10.2015 / 16:26
1
answer

Query in HQL using Hibernate

How to make a query to return the result to below in HQL Result | quantidade | quantidade erro | desc | | 2 | 1 | TESTE 1 | | 3 | 2 | TESTE 2 | | 1 | 1 | TESTE 3...
asked by 06.07.2015 / 16:38
2
answers

Code in java causes persistence problem

After adding the following lines to my class MetaDicas.java, a persistence problem appeared that there was not before: Added lines: @OneToMany(cascade=CascadeType.ALL) @JoinColumn private List<Integer> notas; Error: >javax.per...
asked by 16.03.2015 / 17:24
3
answers

PostgreSQL Query - How to do this?

How do I do a SQL query on this table: ID Col2 Col1 -- ---- ---- 11 1 A 12 2 D 13 3 G 14 1 B 15 2 E 16 3 H 17 1 C 18 2 F 19 3 I To return this result: 1 A B C 2 D E F 3 G H...
asked by 24.02.2015 / 22:21
1
answer

Error in EmbeddedId

I have the composite key below, the problem is that when creating schema and saving the values, Hibernate is inverting the values of TipoContrato with Distribuidora and vice versa. Has anyone had a similar anomaly using e...
asked by 30.09.2014 / 22:37
1
answer

Preventing entries from being deleted using Hibernate

Is there any way I can make sure that a particular table entry in the database is not excluded? For example, I created a usuários table in the database through the User class using the Hibernate and JPA anotations and would li...
asked by 24.09.2014 / 19:29
1
answer

How to do a random search using JPQL script in JPA2

The idea is basically to look for an X number of persisted entities in a random way, and these entities can not be repeated. The question is, can you perform this type of search by creating and executing a JPQL script ?, or is it necessary to im...
asked by 02.10.2014 / 16:23