Questions tagged as 'hibernate'

1
answer

How to solve the error Caused by: java.lang.NullPointerException in getSessionFactory ()

This error message is appearing to me Herearethelinesthatgaveerror:publicclassHibernateUtil{privatestaticfinalSessionFactorysessionFactory=buildSessionFactory();privatestaticSessionFactorybuildSessionFactory(){try{Configurationconfiguration=n...
asked by 14.04.2015 / 17:30
1
answer

String Cast for int Hibernate

Does anyone know how to do a cast from String to int within Query in this search, the variable "searchString"? @Query("SELECT s FROM StoreOrder s INNER JOIN s.user u WHERE lower(u.fullname) LIKE %:searchString% OR u.totalamount=:...
asked by 20.03.2015 / 18:07
1
answer

Hibernate saves twice the entity executed within the dialog of the firstfaces

When the save button is on the page it works normally and saves the entity but I open a dialog to confirm the data to be saved and hibernate saves twice very strange the method to save out of dialog works correctly but inside it performs two time...
asked by 17.01.2015 / 17:14
1
answer

Problem with @Autowire Spring + Hibernate and Junit

Good night, I'm trying to create a project using Hibernate and Spring, I was successful creating some configurations, I even managed to generate the database by initializing the application using Spring, however I'm "stuck" in creating my DAO's,...
asked by 29.12.2014 / 18:37
1
answer

Relationship between entities

I can not delete the selected object. I have two classes, Autor and Livro , basic operating example, to learn how to use Java Server Faces, so far so good, working and so on. The problem is that in the @ManyToMany relation, when...
asked by 22.09.2014 / 14:34
1
answer

Error in ManyToMany relationship in Hibernate

I have a problem with @manyToMany . It's giving the error:    org.hibernate.loader.MultipleBagFetchException: can not simultaneously fetch multiple bags Follow my template: @Entity @Table(name = "sar_evento", schema = "sar") @Sequ...
asked by 20.10.2014 / 20:46
1
answer

Count with Hibernate Criteria

I have two tables, Products and Sales Items In the sales items table I have an FK of products. I want to query using hibernate criteria. select count(itensvenda.prdcodigo), produtos.prddescricao from itensvenda inner join produtos on iten...
asked by 08.09.2014 / 05:22
1
answer

Best way to provide Sessions for DAO's

I was searching the internet for ways to inject Sessions into DAO's this:    HibernateUtil This form is about implementing a utility class that will configure, instantiate, and make available a org.hibernate.SessionFactory object t...
asked by 09.07.2014 / 05:21
2
answers

Return of select objects (ComboBox) with Hibernate + JSP + VRaptor. Does not fill relationship between tables

I have an object TabelaPrecoItem with all the structure formed and almost everything working, follows the model model. @Entity @Table(name = "fov_tabela_preco_itens") public class TabelaPrecoItem implements Serializable {...
asked by 16.05.2014 / 15:15
1
answer

Map Hibernate classes with composite-id and joined-subclass

How can I map a class with composite-id and extend another class? I'm using the example in: http://www.javacodegeeks.com/2012/08/hibernate-composite-ids-with.html I have tried to change the code, but when I try to insert data using this m...
asked by 28.03.2014 / 14:31