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
-
3
votes1
answer359
viewsSlow search for Hibernate Search index
That’s a crosspost that I did in the stackoverflow in English. It is difficult to understand (and correct) this problem. I’ll put it here to see if anyone in our community has been through this and…
-
3
votes2
answers3052
viewsHow to work with Postgresql array data types using Hibernate
How to perform object recovery and saving using type columns array using the Hibernate? In my case I want to save String. How I define in model the object? I found it on the net some examples but…
-
3
votes1
answer1064
viewsI can’t connect Jpa to Postgresql at all
Good I’m trying to connect the postgresql, however, without success. My application will be an application jsf and so I’m using persistence. <?xml version="1.0" encoding="UTF-8"?>…
-
3
votes1
answer5577
viewsHow to change the default postgresql schema in persistence.xml in a java application
I am developing an application and I have a certain difficulty to change the default scheme of the application. I am using Postgresql in a Java application with JPA and Hibernate as implementation.…
-
3
votes1
answer1204
viewsHibernate with multiple databases in the same application
A system uses for each client a separate database, let’s say I will have 500 clients, in which case my database server would have 500 data bases, example: cliente1 cliente2 cliente3 In the Hibernate…
-
3
votes1
answer741
viewsUpdate all schemas with multitenancy architecture
Good morning. Next, I have a multitenancy application using Hibernate with JPA. We recently implemented the multitenancy architecture and persistence.xml was configured to automatically update the…
-
3
votes1
answer100
viewsMethod not found using JPA
I created a method for autocomplete. However when I invoke this method it is not found, follow below error: Advertência: /pessoal/cadastrar.xhtml @35,186…
-
3
votes1
answer130
viewsin.createNativeQuery executes first than in.persist and now?
I’m developing an application with Hibernate + Spring mv. spring takes care of the Entitymanager dependency for my DAO, but I have the following problem. i persist an object called User then I run…
-
3
votes1
answer218
viewsHibernate Criterias - Group Dates
Currently I can group dates using Projections.sqlGroupProjection(). When my date field is in the same class as I create the Criteria, it works perfectly. The problem is when I create an alias, and…
-
3
votes1
answer1036
viewsWhat is the simple way to create a Webservice Rest from an existing Dynanic Java Web project?
Fala galera I’m a beginner in the world of java and created a Dynamic web project where I use Hibernate, Primefaces and Tomcat. Everything is working, screens, records (CRUD) and stuff. Only now I…
-
3
votes1
answer690
views -
3
votes1
answer1148
viewsHow to structure Hibernate Entity relationship annotations?
I would like to understand the difference between Hibernate annotations with JPA: @Onetoone, @Onetomany, @Manytomany and @Manytoone from Hibernate, how it works?
-
3
votes1
answer1013
viewsI cannot generate the table by Hibernate
I’m trying to create tables automatically by Hibernate, but I’m not succeeding. The Iberian libraries are correct. mysql connector is referenced as well as Hibernate libraries. I believe the problem…
-
3
votes1
answer413
viewsTemporary table that Hibernate creates
I’m using JPA and Hibernate 4.3.11 when running a simple application To test the bank connection Firebird 2.5 the Hibernate is generating A temporary table with the start HT_. Example: created the…
-
3
votes1
answer1738
viewsLazy Load Onetomany
Hello. I’m having trouble getting my relationships fetch = Fetchtype.LAZY to work with the @Onetomany annotation. In my Notafiscal entity, there are several lists fetch = Fetchtype.LAZY, when…
-
3
votes1
answer87
viewsWhat dependencies do I need to add to the Glassfish folders?
Fala galera! I am using the Hibernate framework in my JSF project. On the computer I’m developing is all right, running though, when I try to deploy on the glassfish server on another machine starts…
-
3
votes2
answers1199
viewsWhere to close Entitymanager
I am developing a Java application, and I am doubtful where to close the Entity Manager. I have an abstract class AbstractService<T> which is extended by all entities of the system, and this…
-
3
votes2
answers3134
viewsHibernate Validator @CPF that can be null
I’m using the Hibernate Validator with the annotation @CPF. It is validating beauty, the problem is that my system can have the CPF field without value (null) and Hibernate does not accept it. I put…
-
3
votes2
answers5194
viewsWhat is the purpose of the "persistence.xml" file?
I’m studying about the Hibernate, And along the way I came up with several doubts, one of my doubts, and that is important for my learning, is about the purpose of the archive persistence.xml which…
-
3
votes2
answers2045
viewsPostgresql Hibernate Id Generation Strategy
I have a system in JEE7 with Hibernate and Postgresql database, the tables are with auto ID generation by Hibernate: @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; What happens…
-
3
votes2
answers677
views -
3
votes1
answer135
viewsMap
I’m having a problem mapping a class in Hibernate 2. I have a table "CONF_PGTO_CLIENTE" that has columns (ID_LOJA, ID_CLIENTE, TIPO_PGTO), all 3 columns are Primary Keys and I need to map this in…
hibernateasked 9 years, 11 months ago Vitor Carvalho 79 -
3
votes1
answer417
viewsJPA error Hibernate = foreign key is returning null
After a long time of research, without success, I decided to post my doubt. I am using JPA/Hibernate and I have two tables: a Pessoa and another Funcionário. The error occurs when I save my data,…
-
3
votes1
answer686
viewsHQL query with ENUM list as parameter
Hello, I have the following problem, follow an example: I have an entity Banda which has as attribute a list of generos List<Generos> generos, Generos is an ENUM with the following values:…
-
3
votes1
answer226
viewsMapping an enumeration
I have a problem with Ibernate: When I try to give wakeup on the server, it gives me the following error message: Use of @Onetomany or @Manytomany Targeting an unmapped class. Saying that I am…
-
3
votes2
answers496
viewsProblem with Fileupload
I had the opportunity to find an application ready on the internet as shown below:…
-
3
votes1
answer3905
viewsHibernate - Uplicate key value violates Unique Constraint
I have the following problem: Person: @Entity @Table(name="tb_pessoa", schema="public") @Inheritance(strategy = InheritanceType.JOINED) public class Pessoa implements Serializable { private static…
-
3
votes1
answer159
viewsRelating entity to more than one entity
Hello, I have in my system the following entities Customer, Supplier and Financial. They all have a list of Contacts, as a bi-directional relationship would look in these molds. public class Client…
-
3
votes1
answer260
viewsIncorrect information when loading bigdecimal entity
I have a table, that one of your columns is a Numeric(25,10) that will be shown the rates. But there are records that will be zeroed ( 0.0000000000 ) In my entity you own that fee, as a Bigdecimal.…
-
3
votes1
answer250
viewsPartial update of object / Do not update null values with JPA
I’m using JPA for a webservice, and I’m using the Merge to update, but it updates all values of my object, there is some way to perform a partial update of it ? Example, only change values that are…
-
3
votes1
answer203
viewsDuplicate mapping error: org.hibernate.Duplicatemappingexceptionn
I am using Hibernate 5 and am having the following problem: Caused by: org.hibernate.DuplicateMappingException: duplicate import: br.edu.unifeob.entidades.apuracao.Avaliacao refers to both…
-
3
votes1
answer397
viewsAnnotation @Manytomany in the same entity/table
My Class: @Entity public class Report extends AbstractModel implements IReport { @Column private String nome; @Column private byte[] arquivoJrxml; @ManyToMany private List<Report> subReports;…
-
3
votes1
answer321
viewsError analysis and correction in DB connection test using Hibernate
Class to test bank connection with Hibernate. package br.drogaria.main; public class HibernatUtilTeste { public static void main(String[] args) { //abre sessão…
-
3
votes0
answers156
viewsHow to implement Flyway in a Javaee Maven project with Hibernate, vRaptor and JPA?
In a project Maven, JPA, with Hibernate and vRaptor integrated, how to implement easily and effectively, the Flyway? Implementing this, my bank will update how it was in developing the <property…
-
3
votes1
answer63
viewsWinforms application stops working if computer goes into hibernation
I have an application in winforms, which is on the company server, so I pull the shortcut to the desktop and the collaborator runs normally. The problem started to happen, when we exchanged some…
-
3
votes1
answer726
viewsReturn values of all months of the year extracting by month
I’m with the following SELECT: SELECT coalesce(sum(vs.total), 0) FROM tabela_exemplo t WHERE extract(year from t.data_entrada) = extract(year from current_date) GROUP BY extract(month from…
-
3
votes1
answer98
viewsA Different Object with the same Identifier value was already Associated with the Session
When I will edit a reservation I get this error in the console: A Different Object with the same Identifier value was already Associated with the Session : [br.com.blumar.events.model.Route#3883]…
-
3
votes1
answer84
views -
3
votes2
answers2034
viewsWhy doesn’t Spring boot use Entitymanager?
Some time ago I was studying Java EE with handouts. Wore JSF and Hibernate. Now I’m working with Spring and Hibernate. But different from Java EE, I don’t create any Entitymanager. It is not…
-
3
votes1
answer93
viewsNullpointerexception when saving an object
I have a save methodRegister and in this method I save the company and its address, it saves the company first, but when saving its address occurs a Nullpointerexception Entity Address Person…
-
3
votes3
answers1706
viewsHibernate and JPA are the same thing?
It is a question of who just took this subject to study but confuses me a lot. I read some articles about ORM and did not understand very well what is one and what is the other, are the same thing?…
-
3
votes1
answer935
viewsJPA/Primefaces - Add/Remove records from a daughter table
I have a problem in a cadastral panel. There is a register of store network in which I am taking care of the implementation. I can normally insert and remove items from the datatable, but this is…
-
3
votes2
answers762
viewsProblems to remove @Manytomany element with @Jointable
I’m having trouble deleting a @Manytomany relationship on JPA. In short, I have 3 tables: USER, PERMISSION and USUARIO_PERMISSAO which is the relationship of the previous ones, the relationship is N…
-
3
votes1
answer392
viewsJPA/Hibernate Entity with Collection for itself
Hello, I have an entity called menu in my system. A menu can be child of another menu and so on. The table has the following structure: The entity is mapped as follows: @Entity…
-
3
votes1
answer376
viewsHow to adapt Hibernate to the DAO standard?
I’m starting to study Hibernate and wanted to "start the right way". The doubt is as follows: For any transaction I need to use the following code: Session session =…
-
3
votes1
answer92
viewsProduct displayed is the smallest within the group (Criteria)
I have a function in the system that I am developing that returns a list of lots in which the batch quantity is greater than zero, searching for the product name (foreign key). Up to this point I…
-
3
votes2
answers2281
viewsSave a foreign key entity with Hibernate 4
I’m starting to study Hibernate and I’d like to know what the method of saving an entity with a foreign key looks like. The following is an example of two entities: Pupil: @Entity(name = "aluno")…
-
3
votes1
answer408
viewsSearch in associative table
How can I do an associative table search ? There are two entities, Pessoa and Time. Where I came from the Personal association_time that has id_person and id_time. My goal is to list all the id_time…
-
3
votes2
answers470
viewsProblems opening connection to JSF and JPA
There’s something wrong with mine persistence.xml? I can’t open the connection. My Bean is like this: import java.util.List; import javax.faces.bean.ManagedBean; import…
-
3
votes2
answers236
viewsHow to find a pattern to maintain the same data modeling between a JSON, POJO, and JPA object?
To facilitate the understanding of my question, follow the following example:: A POJO: public class Person { private String name; private String location; } String JSON: String json = {name:"Jose",…