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
-
1
votes0
answers63
viewsSimple error trying to use Hibernate + JPA
Good morning, I’m starting to create a simple register with Hibernate. I have the following classes Java link. http://pastebin.com/vgDn9U3Y Hibernate.cfg.xml http://pastebin.com/06kA87Lv Form action…
-
1
votes1
answer181
viewsJasper Studio with Hibernate Session
I’m trying to add a connection in Jasper Studio via the option "Hibernate Session" I added the . Hibernate jars, the Mysql Driver and I’ve uploaded the Hibernate.cfg.xml file, but still, I always…
-
1
votes1
answer87
viewsFill in a jCombobox using Join and Hibernate
I’m doing a job at college where I’m supposed to create a scheduling system for car dealerships. The technologies used are Java, Swing, and Hibernate. I divided the project in layers to facilitate,…
-
1
votes1
answer477
viewsError: Entitymanager is closed
My command system, when trying to merge tables, I use Entitymanager.merge, but the following error occurs: Entitymanager is closed. Follows one of the functions of my code that occurs this error:…
-
1
votes1
answer1191
viewsproperty "Hibernate.hbm2ddl.auto" value="update" is not working with postgres
The configuration property of persistence.xml: property name="hibernate.hbm2ddl.auto" value="update" Not working or better is giving error at the time of deploy. If I use how create works but even…
-
1
votes1
answer431
viewsJPA / Hibernate - Lazyloading Onetomany duplicating records
Well, I have the following structure: public class FinCxaTransacaoGrupo { @Id @GeneratedValue(generator="gen-uuid") @GenericGenerator(name="gen-uuid", strategy = "uuid2") @Type(type="pg-uuid")…
-
1
votes1
answer561
viewsPersist associative table in manyTomany
I have the following problem: How will I persist in an associative table that has no class ? I have two classes: Person and Time, where I want to make the relationship between people and teams. In…
-
1
votes1
answer133
viewsI cannot download Hibernate and mysql dependencies #Algaworks
I’m following the playbook algaworks-ebook-java-ee-7-com-jsf-primefaces-e-cdi-2a-edicao-20150228 and in the financial project to put the dependencies of the hibenate and mysql in the pom xml I can’t…
-
1
votes1
answer39
viewsProblem with controlling connections with the Bank
I am having some problems connecting to the database. Follow my code and the exception. Code @Repository public class MinhaClasseDAOImpl implements MinhaClasseDAO{ protected EntityManagerFactory…
-
1
votes1
answer1605
viewsRemoving items from a Onetomany relation by default
I have an entity that has a list attribute of type Onetomany: @Entity public class Pai { private List<Filho> filhos; //demais atributos... @OneToMany(mappedBy = "pai", cascade =…
-
1
votes0
answers60
viewsTwo Jboss servers. Start and one not. Same configuration
I have two servers that run Jboss with the same parameters for the same application. Although the log clearly indicates the error, I do not understand why one server works and the other does not. It…
-
1
votes1
answer171
views'Transaction is not active' after receiving error for not being able to delete
Guys tried to mount a crud for study and I came across the following situation. I’m using JPA and hibernate. When trying to delete a record that has reference in another table is launched an…
-
1
votes0
answers94
viewsHow to initialize Hibernate with Reflection
Hello, I need to initialize a list using Hibernate.initialize(list) within a Generic DAO. User Model @Entity public class Usuario { @Expose @ManyToMany(cascade = {CascadeType.PERSIST,…
-
1
votes1
answer131
viewsMultiple @Elementcollection in two different classes @Embeddable
I have an entity with two classes Embedded of the same kind and each has a Elementcollection same type, too. Business logic seems to be correct, but I’m experiencing some problems with the lack of…
-
1
votes1
answer1707
viewsmethod save: org.hibernate.Exception.Constraintviolationexception: could not execute statement
Guys, I have a little screen that registers name and type. When I click type Physics is rendered the date of birth and I need to save it and when I click Legal I have to save a branch of activity…
-
1
votes1
answer614
viewsJava project problems with CDI (Weld) + Hibernate + Primefaces
good night. I’m having trouble executing my project with the structure described in the title of this post. I am using Hibernate, with control of transactions by the server (JTA). Follows the…
-
1
votes0
answers50
viewsArbitrary Java/Hibernate Specialized Entity Load from Associations
So, next ... I have the following class structure that treated by Hibernate: ( <|- is a symbol to denote inheritance, 1 --* is a symbol to denote an association one for many) [Pessoa] <|-…
-
1
votes2
answers224
viewsWhy does Hibernate not list results if the select query calls table null field?
I have a Product Entity-Class. @Entity public class Produto implements Serializable{ @Id @GeneratedValue private long id; @Column(length = 70, nullable = false) private String cod; @Column(length =…
-
1
votes1
answer535
viewsGeneration of Billets with Bopepo
I have a system that generates an accounts receivable, and I am trying to implement the generation of bank slips, my teacher Advisor indicated me the tool 'Bopepo' Jrmum. I entered in my system and…
-
1
votes0
answers140
viewsEdit datatable in Javaweb Dialog box - JSF
I need to edit a datatable line when I open the dialog box, but it’s not working the way I’m doing, I did a test on the console, and the object is null when I send the edit, it’s like I don’t load.…
-
1
votes0
answers266
viewsjava.lang.Illegalstateexception: Cannot create a Session after the Response has been Committed
Good morning guys, I am with a strange problem in my application only after Gero War and send to Integrator, the application does not even open the Login screen, is returned this error: INFO:…
-
1
votes3
answers813
viewsHow to find Session in Hibernate 5.2.3.Final
hello! Guys I’m changing my Hibernate from version 4.3.8.Final to 5.2.3.Final. Now I’m not getting the Hibernate Session like I used to, like this: (Session) manager.unwrap(Session.class); Gives…
-
1
votes0
answers214
viewsProblem when a relationship persists
I have 2 entities, the Submodel has a list of possible Options. I made a unidirectional Onetomany relation, when I make any persistence in the entity Submodel that the list of Options this empty the…
-
1
votes1
answer55
viewsJPA in java web
I am with a JAVA WEB project and I am having problems with Hibernate. The error is as follows: Informações: HCANN000001: Hibernate Commons Annotations {4.0.2.Final} Informações: HHH000412: Hibernate…
-
1
votes1
answer74
viewsBest Scenario: Recording n table for n Hibernate
I have some doubts about recording records in tables from N to M. My scenario is this:: In my bank when I insert a doctor in the table "Doctor" the medical record, and in "Doctor x Specialty" the…
-
1
votes1
answer346
viewsHibernate does not update information
My problem if it comes to an update unsuccessfully follows the code below. EntityManager manager=JpaUtil.getEntityManager(); EntityTransaction trx= manager.getTransaction(); trx.begin();…
-
1
votes1
answer81
viewsRemove default message @Pattern JPA
I need a help from you. I am creating a web service in java using jersey and Ibernate. To validate the fields informed by who calls the service I used for one of the fields the JPA @Pattern…
-
1
votes2
answers830
viewsIreport Tibco - Error in XML processing: no element found
Hello !! I’m having trouble generating the report ,I’m using jsf,Hibernate,mysql follow my bean. @Named @RequestScoped public class RelatorioBean implements Serializable { private static final long…
-
1
votes2
answers153
viewsMany to One Hibernate Java
I have 2 entities: Contracts, which has only id, number Additive, which has id, number, contract The additive contract is a foreign key, in the database is working fine works like this: 1 contract…
-
1
votes1
answer116
viewsPrimefaces does not locate Panel and Datatable components
I’m doing a job where I use Primefaces + Ajax + Hibernate. I have a screen to include/change a client that should open in a modal every time the user clicks on the button. And in this same code I…
-
1
votes1
answer422
viewsHibernate/JPA - Object is an Unsaved Transient instance
Good afternoon people! When saving a new contract adjustment I have to research other contracts "similar" to what I’m readjusting and readjusting them as well. For that I was trying to use a…
-
1
votes1
answer126
viewsInheritance problem with HIBERNATE
Well, my problem is this, I have an abstract class Official and two subclasses Attendant and Dentist inherited. I also have a class User, which has as attributes login, ... , .... , ... and an…
-
1
votes1
answer208
viewsHibernate error while running web project
I have an error that I could not solve, I start my project and it runs straight. When I access the project via the web, I log in and it. When I click on any button, it gives this error below:…
-
1
votes1
answer1539
viewsERROR: column "type" of relation "tb_person" does not exist
Hello. I am trying to persist a record, but when I run, it is returning the error below: // ... @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "tipo", discriminatorType…
-
1
votes1
answer663
views -
1
votes2
answers381
viewsHibernate connection problems with Mysql Database
Hello, I am starting my studies in Hibernate and I am not making a connection to the Mysql Database. Below is my code: import java.util.Calendar; import javax.persistence.Entity; import…
-
1
votes0
answers142
viewsNo Persistence Provider for Entitymanager named sample
When I use the application in Eclipse, with tomcat8 it runs smoothly, then I run the package using Maven and deploy it in tomcat8 outside the eclipse and get the error below. Jars are coming from…
-
1
votes1
answer561
viewsUsing enums in java
I created an Enum and I need to set the values in the bank that way: If it is Revenue, the value is 0; If it is Expense, the value is 1; This is my Enum: public enum EntryType { INCOME, OUTPUT; } In…
-
1
votes2
answers939
viewsUse foreign key as primary key - Hibernate
I am implementing Hibernate in my project and arrived at a stage where I am having problems to map my entities. I have an entity called Book and would like to create a Stock entity to store the…
-
1
votes1
answer447
viewsHierarchical selects. Parent-child relationship in the same table
I have a Product Entity regarding @Manytoone. And I need to bring the last child record of each parent. I made a select in the table and this bringing what I need more I’m not right to do the same…
-
1
votes0
answers395
viewsJava Hibernate Query (HQL) with foreign key... ERROR!
I need help with my code, I have two tables: -CDF (official register) CREATE TABLE public.cdf( ativo character varying(1) COLLATE pg_catalog."default", reg integer NOT NULL, nome character…
-
1
votes1
answer65
viewsProblem to recover data using Hibernate
I can list the Customer and their Animals, but I can’t list the Animal Breeds. Follows the involved relationship classes: Client class @Entity public class Cliente extends Pessoa {…
-
1
votes1
answer5444
viewsHow to map entities with composite keys in JPA?
I have a system where all tables in the database have a column empresa, which is part of PRIMARY KEY. In the client table, I have a column id (autoincrement), which together with the empresa form a…
-
1
votes2
answers1024
viewsHow to Sort List (Hibernate)
How can I order a List with java and Hibernate? I have an abstract class with this method public List<T> listarContas(String where) { String consulta = "FROM " + entityClass.getSimpleName()+ "…
-
1
votes2
answers99
viewsDatatable data is not displayed, even with loading of Arraylist running correctly
Guys, I am loading a JSF datatable with an Arraylist, but the result is not displayed in any way, follow as my code: index.xhtml <h:body> <h1>Novo Jogo</h1> <j:form>…
-
1
votes1
answer171
viewsTable names in Hibernate are created with lower case letters
I am trying to turn the following Entity into a table in Postgre using Hibernate @Entity @Table(name="Usuarios") public class Usuario implements Serializable { ... } the problem is that when the…
-
1
votes1
answer298
viewsHibernate and object list
I’m developing my first java application, desktop application with Netbeans and Hibernate. I have the tables membros and estadocivil. The member has a marital status. I mapped the classes using…
-
1
votes1
answer151
viewsHelp with JPQL query
I am trying to return a group query together with the product entity by returning all the data from the product table and the sum of the quantity. I get a mistake which is this: Exception in thread…
-
1
votes1
answer125
viewsquery model.vo a solution with jpql and subqueryes
I have the following query in Mysql wanting to move to JPQL and I am doubtful in syntax: SELECT a2.produto , a2.descricao, a2.quantidade_recente, Soma from (SELECT p.codigoProduto,…
-
1
votes0
answers46
viewshow to use query with more than one field (Moldel .vo) in a datamodel
I have the following query and I am willing to put this list with products and the sum in a datamodel list. public List<Filtro> listarProdutosDoGerenteRegional() { try { return…