Most voted "hibernate" questions
Hibernate is a framework for object-relational mapping written in the Java language, but is also available in . Net as the name Nhibernate.
Learn more…934 questions
Sort by count of
-
2
votes2
answers136
viewsSPRING - Count the number of queries made in a request
I have a simple requisition GET for example, to search a product for your ID: @Autowired private ProdutoRepository produtos; @GetMapping public Optional<Produto> listarProduto(){ return…
-
2
votes1
answer75
viewsWho implements the Spring Repository interfaces?
We have the interface JpaRepository which we can use from your import with: import org.springframework.data.jpa.repository.JpaRepository; From it we have the standard methods to use, such as the…
-
1
votes1
answer979
viewsJPQL to view bank date/time with Hibernate without query
There is a way to query the database date/time without using activate query? On the Oracle I do this: SQLQuery qry = session.createSQLQuery("SELECT SYSDATE FROM dual"); But I would like a general…
-
1
votes1
answer1873
viewsProblem when inserting data into postgresql with jpa implemented by Hibernate
Good afternoon I would like to know why this error is happening, the project is with all the jars in the lib and in the path but when I will insert is returning me an error. Apr 19, 2014 4:49:27 PM…
-
1
votes1
answer445
viewsGenerating tables in sql-server with Hibernate
I am migrating a Java system to work with 2 or more databases. I created the tables for Firebird using Hibernate without many problems. The second database was not successful. SQL-Server. Because…
-
1
votes2
answers1966
viewsReturn 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 of the model. @Entity @Table(name = "fov_tabela_preco_itens") public class…
-
1
votes1
answer698
viewsSession is closed! Spring + JPA (Hibernate)
I’m trying to make an example of JPA + Spring. But I’m having trouble managing transactions. persistence.xml: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0"…
-
1
votes1
answer262
viewsUnable to locate current JTA Transaction
The project is divided into the following modules: test-persistence; test-services; web test; I use Glassfish 4 as an application server and it has a connection pool configured for connections to…
-
1
votes2
answers263
viewsHibernate Warning HHH000444 using Oracle 10g with Wildfly 8.0.0 - follow-on Locking
When making some queries in a view using JPA (2.1) with hibernate, I’m having this Warning. Though it’s working and it’s only one Warning, It bothers me a little bit. WARN…
-
1
votes1
answer807
viewsPersist an entity that is inherited
I have an entity Person which is inherited in another entity Administrator. In the bank I already have data in the entity Person and I want to associate a Person in the entity Administrator. How can…
-
1
votes1
answer142
viewsProblem with JPA
Classes and persistence.xml below. The problem is: entityManager is Coming NULL. @ManagedBean(name="pessoaController") @SessionScoped public class PessoaController{ private List<Pessoa>…
-
1
votes1
answer213
viewsData modeling problems with Persistence.xml
I created a college application to create automatic tables by Hibernate with JPA however it gave error in some tables, that were these; Catalogued Orderly Commodity but this generating the following…
-
1
votes1
answer195
viewsMap Hibernate classes with Posit-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 tried to change the code, but…
-
1
votes1
answer894
viewsHow to insert image in Mysql using Hibernate?
I am using java with Hibernate and would like to know how to insert an image in the mysql database. I have several information being persisted with Hibernate, missing only the image.
-
1
votes1
answer1410
viewsConvert html page to jsf
Well I downloaded a template that will be the index of my project, so it is already configured the web.xhtml, already run other jsf projects, however I am starting another project and I want to put…
-
1
votes1
answer498
viewsError running JSF page on Tomcat
Guys, I have a problem here that is hard to solve. I’m trying to list some disciplines on a JSF page, follow the code: Disciplinabean.java @ManagedBean(name="disciplinaBean") @SessionScoped public…
-
1
votes2
answers396
viewsHow to create a stored Postgresql database from a Java source
Searching the internet for a solution to create a database on a Postgresql server for my Spring project, I found the following topic on Stackoverflow:…
-
1
votes1
answer182
viewsApplication error in Heroku
I made an application using Intellij using database and everything is working fine, but as soon as I gave the push to Heroku I got a message: Application Error. An error occurred in the application…
-
1
votes0
answers364
views(Hibernate2) How to use createSQLQuery to return uncharted values
Good afternoon, Using HQL, I’m having trouble catching the name of customer price list. Therefore, I decided to try using Native SQL via Hibernate. However, I am not able to do it in Hibernate 2...…
-
1
votes0
answers353
viewsTomcat + jsf + Hibernate application = Slow to boot
My application is very slow to boot. Follow the eclipse log where it takes longer: INFO: HHH000397: Using Astquerytranslatorfactory
-
1
votes0
answers118
viewsHibernate + Maven + Glassfish
I have a Maven Project, which uses Hibernate, and has all the dependencies ok. I’ve already created the connection pool in glassfish. The problem is that even the class mapped with the annotations…
-
1
votes1
answer1667
viewsString Cast for int Hibernate
Does anyone know how to cast a String for int within the query in this query, the variable "searchString"? @Query("SELECT s FROM StoreOrder s INNER JOIN s.user u WHERE lower(u.fullname) LIKE…
-
1
votes1
answer117
viewsBest Way to Provide Sessions for DAO’s
I was researching on the internet ways to inject Sessions in the DAO’s this: Hibernateutil This way is to implement a utility class that will configure, instantiate and make available an object…
-
1
votes1
answer903
viewsHow to resolve the error Caused by: java.lang.Nullpointerexception in getSessionFactory()
Is popping this error message for me Here are the lines that gave error: public class HibernateUtil { private static final SessionFactory sessionFactory = buildSessionFactory(); private static…
-
1
votes1
answer2319
viewsCheck if the user informed data already exist in the database before entering
I need to check in the database if the information that the user is trying to enter already exists, for example: In the registration of a company, I cannot allow the same CNPJ for others. I am doing…
-
1
votes1
answer1481
viewsConfigure Spring applicationContext by taking advantage of other configuration files
I got the following hibernate.cfg.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"…
-
1
votes1
answer523
viewsError in JPQL query
When I am starting my server the following error is happening unexpected token: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IServidorMensalRepositorio':…
-
1
votes1
answer390
viewsError switching H2 application to Postgresql
I was developing a bank application H2 just for testing and everything was working. At the end of the implementation I changed the connection to JPA to the PostgreSQL, only when I did this the…
-
1
votes0
answers159
views"java.sql.Sqlexception: Incorrect string value: xE7 xF5 for column" error
Good afternoon, I’m having the error below whenever I try to run an indexing method. ERROR: javax.servlet.ServletException: net.alforria.util.InfraException:…
-
1
votes0
answers154
viewsHibernate + Ireports
I’m trying to connect a Spring MVC project to Hibernate using JSP. But a problem arises when I try to create a connection to import data to a report using Jasperreports + Ireport technology. When I…
-
1
votes0
answers118
viewsHibernate Soft Delete Spring Boot Behavior
I wonder if there is soft delete functionality in Hibernate, because today I am doing in a way that I consider gambiarra, something to type: @Entity @Where(clause="ativo=1") Controller: Rejeicao rej…
-
1
votes1
answer82
viewsError regarding the number of parameters in Query when not using Query, what is wrong?
I’m having difficulty using Hiberante/JPA with composite key, I believe the problem is there, although the generated exception stacktrace points to another place that is not superficially related to…
-
1
votes1
answer79
viewsdata persistence in two or more databases simultaneously
Greetings! I would like someone to help me with some example of a JSF application that persists data simultaneously in more than one database, that is: will connect there are 2+ databases and will…
-
1
votes0
answers539
viewsHow to create a JSF shopping cart with Hibernate Postgres Glassfich and primefaces?
I need to create a shopping cart like in a E-comerce but all on the same page, and I do not know where to start, I am new in programming I am with many doubts. In my design I use…
-
1
votes1
answer989
viewsCount with Hibernate Criteria
I have two tables, Products and Itensvenda In the itensvenda table I have a FK of products. I want to make the following query using Hibernate criteria. select count(itensvenda.prdcodigo),…
-
1
votes1
answer756
viewsRelationship between entities
I am unable to make the deletion of the selected object. I have two classes, Autor and Livro, Basic example of working, to learn the use of Java Server Faces, so far everything well, functioning and…
-
1
votes1
answer181
viewsHow do I popular an arraylist<Type> with a result brought from the mysql database, using Hibernate?
On many topics I see an excerpt of code that I can’t reproduce: Query query = session.createQuery() I cannot create this Session object using the createQuery() method. Can someone show me an example…
-
1
votes1
answer4739
viewsorphanRemoval JPA
How orphanRemoval works? Why when I put it on a list does not work ex: @OneToMany(mappedBy = "simulationMedia", cascade = CascadeType.ALL, orphanRemoval = true) @JsonIgnore private…
-
1
votes1
answer668
viewsjava.lang.Outofmemoryerror: Java heap space
I need help trying to clear up these 2 mistakes: Exception in thread "Thread-4" java.lang.OutOfMemoryError: Java heap space at…
-
1
votes2
answers140
viewsAND operators and OR
I recently started using the Criteria API because I need to make queries that would be very complex with HQL. How I use the operators AND and OR in queries with Criteria API?…
-
1
votes1
answer361
viewsJava Web Authentication Control
Good evening, I’m doing a project using JSF, Hibernate and Tomcat and one of the requirements is: X RF 01. The system must use access passwords for secure application control. What could I use in…
-
1
votes1
answer51
viewsHow to connect a Query to a Container?
TypedQuery<Empteste> minhaLista = em.createQuery("Select d from Empteste", Empteste.class); List<Empteste> results = minhaLista.getResultList(); I want that my list result to appear in…
-
1
votes2
answers1483
viewspersistence.xml for development and other for production?
I have my persistence.xml configured for a local database. <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/meubanco"/> <property…
-
1
votes1
answer840
viewsErro em relacionamento Manytomany no Hibernate
I have a problem with @manyToMany. You’re making the mistake: org.hibernate.Multiplebagfetchexception: cannot simultaneously fetch Multiple bags Follows my model: @Entity @Table(name = "sar_evento",…
-
1
votes2
answers184
viewsHow to interrupt the database query using time out in Hibernate?
I am developing an application that queries a gigantic database, so I would like to maintain the integrity of this allowing Hibernate to query up to 30 seconds. Faced with this problem, what would…
-
1
votes0
answers63
viewsAdding up results
I’m starting to use the framework uaiCriteria and I need a result that is a sum of records in a period. Something like (simplified): select sum(valor), sum(desconto), data, idpessoa from tabela…
-
1
votes2
answers419
viewsHibernate ORDER BY ASC|DESC does not work by passing parameter
Well, I’m having a problem ordering a query, where I’m passing the name of the field along with ASC or DESC as parameter for the query, however Hibernate is not finding itself, returning the query…
-
1
votes0
answers54
views -
1
votes0
answers159
viewsInstability recovering updated objects list
I am facing problems with Hibernate that seems to be related to the cache object. I have an entity, let’s call it A, with an attribute mapped list with @OneToMany (cascade = CascadeType.ALL,…
-
1
votes0
answers279
viewsError: Java.lang.Stackoverflowerror:, com like no Hibernate(loop Query.getResultList())
I have a method: public static List<Texto> getTextoPorIdAlternativoLike(String idAlternativoTexto) { Texto texto = new Texto(); String where = "t.idAlternativo like :idAlternativo";…