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
votes0
answers425
viewsCriteria: Subquery with multiple columns
I have the problem and I can’t solve it. How to turn this query into Nhibernate Criteria. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) IN (SELECT prodid, qty FROM item WHERE ordid = 365)…
-
2
votes1
answer755
viewsImproved Hibernate Performance
I am developing an application in Swing using Hibernate, but I still do not know all the tricks that the tool has and the development used this providing me a beautiful knowledge, but I came across…
-
2
votes2
answers437
viewsSelect if the collection contains a particular object with Hibernate Criteria
I’m trying to make a query that would be something like the method contains of interface Collection java. I have a class GrupoProdutos and want to select the groups if your Collection, calling for…
-
2
votes2
answers711
viewsHow to persist the String of an Enumerator in the Database?
I have the following Enumerator: public enum ETipoCasa{ Propria, Alugada, Financiada, Cedida; } And I’m trying to persist in the database the string of this enumerator as an example: Casa casa = new…
-
2
votes1
answer2863
viewsJava how to do a native query and return to a DTO list
I am using Spring Hibernate and am trying to make a native query with Join back to a DTO list. I tried using @Query(value="", nativeQuery=true) with a List but it returns the serialized attributes.…
-
2
votes1
answer746
viewsProblem running runnable JAR: Unable to load class [com.microsoft.sqlserver.jdbc.Sqlserverdriver]
I am facing the following problem: we are in the development phase of a project, which involves the following technologies, SQL Server, Hibernate, Maven, Quartz and java. After finishing one of the…
-
2
votes1
answer2235
viewsException org.hibernate.Propertyaccessexception: could not set a field value by Reflection Setter
I’m trying to map the following model in JPA with Hibernate: Company table: CREATE TABLE empresa ( id_empresa INT(11) NOT NULL AUTO_INCREMENT , PRIMARY KEY (id_empresa) ) ENGINE = InnoDB DEFAULT…
-
2
votes1
answer189
viewsHow to generate default values with JPA Hibernate
I would like to optimize my code and my work with the following situation. I have an address entity that has a type, ie another entity called Tpendereco. Since, this table has standard values,…
-
2
votes1
answer831
viewsSubquery in the select clause with JPA Criteria
I was searching how to do a subquery in the select clause with Criteria of a select of this type: SELECT tabela1.*,tabela2.*, (SELECT MAX(tabela5.AtrDatatabela5) FROM .Tabela3 AS tabela3 INNER JOIN…
-
2
votes2
answers2352
viewsError building JSON of an Object recovered by Hibernate
Error building Json of an Object recovered by Hibernate. session.getTransaction().begin(); ArrayList<Cliente> lista = new ArrayList<>(session.createCriteria(Cliente.class).list());…
-
2
votes1
answer478
viewsError org.hibernate.Lazyinitializationexception how to resolve?
I know this error is derived from trying to fetch some data from the database when I have no session open. But the biggest problem for me is that this error is appearing to me completely random, as…
-
2
votes1
answer2128
viewsError: "Lock Wait timeout exceeded; Try restarting transaction"
I’m developing a java application that uses Hibernate to do the mapping. I created the DAO’s of the classes, but when doing Insert, update and delete operations it returns me this Mysql error.…
-
2
votes0
answers125
viewsC3P0 Connection Pool
I have the following properties in my Hibernate XML to Connection Pool taken off the internet: <property name="hibernate.c3p0.min_size" value="4"/> <property name="hibernate.c3p0.max_size"…
-
2
votes1
answer1330
viewsInheritance with jpa
Hello, I have a class called Usuario that is abstract and I have the class UsuarioComum and Administrador which they inherit from Usuario, I am using JPA annotations to generate the automatic…
-
2
votes0
answers218
viewsMicroservices + JPA Entities
I have two REST services (separate projects) responding to the following entities with JPA (@Entity) mapping and each with its own database. Product(ID and TITLE) and Category (ID and TITLE) I found…
-
2
votes1
answer1026
viewsMap objects through Hibernate with "decentralized" data
I do not know if the decentralized term of the title is correct, if someone is not willing to change. But let’s get down to business. I have a scenario where I am developing a program that manages…
-
2
votes2
answers1125
viewsTables are not automatically created by Hibernate in Mysql
Hibernate cannot create the table in the database already created (drogaria_teste). Below is code. Hibernate.cfg.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE…
-
2
votes2
answers952
viewsEnum as Hibernate Parameter Namedquery
Is there any way to pass as a parameter in a NamedQuery the value of Enum. public enum TipoConta{ CREDITO("Cartao de Credito"), DEBITO("Cartao de Debito"); private final String descricao;…
-
2
votes0
answers492
viewsBeanfactory not initialized or already closed - call 'refresh' before accessing Beans via the Applicationcontext
I have this error at the time of running my application: 05-Oct-2016 21:18:25.586 SEVERE [localhost-startStop-26] org.apache.catalina.core.StandardContext.listenerStop Exception sending context…
-
2
votes1
answer177
viewsIdentify an Object property in Java+JPA and change it
I’m creating a class to get a database record and write to another database. I’m using JPA and bumped into a problem. I’m doing a generic insertion and I have to clean up the ID of the table to be…
-
2
votes1
answer226
viewsJPA+Hibernate releasing update alone
Hello, I have an object that is managed by Hibernate. On screen, an attribute of this object is updated the value and Hibernate immediately triggers an update in the database, without even going…
-
2
votes1
answer877
viewsLeakage of connections with Hibernate
My system presented sporadic crashes and I ended up discovering that this happened due to processes that opened a connection but, due to some error, did not close it (Connection Leak). I solved…
-
2
votes0
answers160
viewsJPA(Hibernate) update entities automatically
I have the following question: I realized that when using JPA (Hibernate) + Spring in a JSF (Primefaces) application my entities are not updated immediately when performing a registration, for…
-
2
votes2
answers444
viewsToo Many Hibernate+Mysql Connections error
I have an application in development in Java using Hibernate and Primefaces, on the item listing screen I have the option to do a search for some information in real time using multiple filters.…
-
2
votes1
answer163
viewsRelationship between classes Composite key error: not Mapped to a single Property
I have a Cvariacaoto class that has a composite key (FK_T, FK_F, FK_F_VARIACAO). Two of these primary key fields (FK_F, FK_F_VARIACAO) are also foreign key to the Fvariacaoto table, in a Manytoone…
-
2
votes0
answers558
viewsjava.lang.Nosuchmethoderror: org.jboss.logging.Logger.debugf. Glassfish 4.1, Hibernate 5.2, Spring 4.3
I cannot upload an application to Glassfish 4.1. It seems to me that the problem is dependency org.jboss.logging I already added it to the project in version 3.3.0 but the error persists. The…
-
2
votes1
answer774
viewsJPA/Hibernate problem with competition and persistence in the JRE
I am working on a project to create a simple server running over Java SE. I am using JPA + Hibernate to perform persistence, but competing routines are a problem. I am spending a lot of time trying…
-
2
votes1
answer1339
viewsDifference between Merge() and getInstace() in JPA/Hibernate
I wonder when I should use merge() to update the object instead of changing it through its reference. Example: Produto p = new Produto(); p.setNome("Bola"); p.setvalor("32); manager.persist(p);…
-
2
votes2
answers303
viewsCache Problem - Writing database data to Java system
I have a system developed in Java using JPA, Hibernate, Primefaces. When I write system registration reflects in the Mysql database normally, until here OK, but when I do unlike the database…
-
2
votes2
answers784
viewsConfigure IP for server access using Hibernate
I have a Java application that uses Hibernate, for development I made the database configuration using localhost but for use on other computers I will need to define the IP that will have the…
-
2
votes1
answer689
viewsJPA does not persist the Object in the database
I have a problem in which I try to persist data in the Database with JPA and Hibernate only that it does not persist the Object. It creates the table but does not persist the data and no exception…
-
2
votes2
answers2116
viewsTomcat V8.5 not booting, error: Child container failed During start
I’m doing a college paper, a simple crud with JSF2, Hibernate, Primefaces and CDI. However at the moment I will initialize the project in Tomcat I have the following error: GRAVE: A child container…
-
2
votes2
answers2446
viewsSelect JPA and Hibernate
I have five entities (Quotation, Sector, Partner, Items and Items), where the user will select a quotation and sector and the list of all items related to this sector will appear, along with the…
-
2
votes1
answer375
viewsTwo id in table Hibernate
Is it possible for two fields to be id in a Hibernate table? I have two ids that need to be single in even table. But I don’t know how to implement.
-
2
votes1
answer58
viewsError creating database with Hibernate and Spring MVC
I have a problem running the application. Error... ERROR [org.springframework.web.servlet.DispatcherServlet] (ServerService Thread Pool -- 58) Context initialization failed:…
-
2
votes0
answers34
viewsEmbeddable Hibernate Mapping
Good morning ! I have a question regarding composite key mapping. The situation is as follows: I have a class whose primary key of the same is composed of two other classes, but I have a third class…
-
2
votes1
answer1072
viewsNotes JPA @Onetomany or Manytoone?
I own the Report Class public class Report{ private String nome; @ManyToOne @JoinColumn( name = "idpai", referencedColumnName = "id" ) private List<Report> subReports getters e setters... } My…
-
2
votes2
answers822
viewsMake a consultation with Ibernate criteria with Spring
Good evening, friends, I have a question. I have a Class called Proposal and another Customer Call. In the client there is the CPF field and a Proposal has a Client. I need to search for…
-
2
votes2
answers236
viewsDatatable does not populate object? JSF
I have the following problem: I have a DataTable which is populated with entities of the type Login that belongs to Usuario as a relationship. A button called Add Login calls the method addLogin()…
-
2
votes0
answers59
viewsSpring JPA - Procedure call with sqlserver dialect
Hello, I have the following configuration in my application file.properties: spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver spring.jpa.hibernate.dialect=…
-
2
votes0
answers155
viewsOne table is not being created - JPA/Hibernate with Mysql
I’m having a problem running my test class: import javax.persistence.EntityManager; import br.com.teste.jpa.c_mapeamento.model.Conta; public class PopulaConta { public static void main(String[]…
-
2
votes1
answer195
viewsRestful with Spring, Hibernate, Maven, Postgresql and Wildfly - Createcriteria
I am doing a Restful project with the following frameworks and am going through a problem, I created a User class to relate to the database, then I created the userDao to carry out the CRUD methods…
-
2
votes0
answers74
viewsJpa/Hibernate causing connection Leak
I have a large project with several classes.There is a connection Leak, every time I make a request, it creates connections coming an hour to hang because of the max of the connection pool. Pojo…
-
2
votes1
answer27
viewsI’m hoping that clicking a jsf radio button with primefaces will disable an inputText
<p:inputText id="txtCidadeFora" value="#{moradorRuaBean.moradorRua.cidade}" disabled="#{moradorRuaBean.ishabilitaCidade == false}"></pmf:campoTexto> Could someone help me? In managedBean…
-
2
votes1
answer111
viewsWhy doesn’t Entitymanager have the createQuery method with typed return?
I am following the project of the book Spring-MVC of Casa Do Código, using the latest version of Hibernate, a 4.0.3. But in a moment, when the book indicated the creation of a typed query through…
-
2
votes1
answer468
viewsHibernate Multitenant problem with identification of current tenancy
I am using Hibernate multitenant by schemas, use Postgresql database. My problem is the following I have a service where I make a select in a public schema table, then for each returned item I have…
-
2
votes1
answer134
viewsProblems with LAZY - could not initialize proxy - in Session
I have a problem trying to load an object that is mapped as LAZY. I mapped my attribute this way: @OneToOne(fetch = FetchType.LAZY) private Obra obra; And I load the data at the time of opening the…
-
2
votes0
answers73
viewsProject error downloaded from github with Jboss 7.1.1
I downloaded a project from github (fj25-financas-web project - Caelum) and added this project to Jboss 7.1.1. When running, these errors occur: 16:07:15,515 ERROR [org.jboss.msc.service.fail] (MSC…
-
2
votes4
answers119
viewsData deletion via Hibernate
In the database used by my application I have a table that I defined as temporary that I write some data but at the end of the process I no longer need the information recorded in that table, how to…
-
2
votes3
answers523
viewsError in Hibernate
I am trying to make a small interaction with the Mysql database but when I run the test class appears the following error: Exception in thread "main" java.lang.Nosuchmethoderror:…