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
votes1
answer717
viewsDelete entity and all its relationships Hibernate
I have the entity Fatura who has a relationship OneToMany with the entity Item. When I try to delete an Invoice I have the following error: Caused by:…
-
2
votes1
answer740
viewsHow to make Hibernate read a table in a Mysql database and write to another table in Postgresql?
I need to consult a database in Mysql and take a table from there to write to a database in Postgresql by Hibernate/JPA. I set up the persistence.xml as follows: <?xml version="1.0"…
-
2
votes2
answers1712
viewsHow to name a Hibernate/JPA Constraint?
Using the class: @Entity public class Pessoa{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long idPessoa; @Column(nullable=false, unique = true) private String nome; @OneToOne…
-
2
votes1
answer286
viewsInstantiate annotated class with Hibernate inheritance using CDI
Good afternoon, I’m creating a project using JSF, CDI, Bootstrap and Hibernate. I would like to know how to work with the following problem, I have created a set of classes to represent a person…
-
2
votes1
answer367
viewsMysql - Foreign key in ON DELETE NO ACTION but runs ON DELETE CASCADE
I’m developing a system using Apache, Hibernate e MySQL. But I’m having a problem during the exclusion of parent entries from a foreign key. The database should prevent deletion, but delete the…
-
2
votes1
answer4566
viewsHow do I resolve the "No Persistence Provider for Entitymanager named" error?
When I try to execute the method Persistence.createEntityManagerFactory("Aluno") class Persistence i get the following error: run: abr 04, 2016 9:11:30 PM org.hibernate.ejb.HibernatePersistence…
-
2
votes3
answers342
viewsWhere should I put a calculation method? In the entity itself or in the business class?
I have an architectural doubt, I believe. I need to create a method that receives a period of dates and an entity in which to execute a search in the period cited. In fact, to ask this question it…
-
2
votes6
answers2011
viewsHibernate is not creating the tables
I am new to the subject Hibernate, for the little I have learned, I believe I did everything right, ie, I lowered the dependencies, I wrote down the classes, etc. Below follows my class example:…
-
2
votes1
answer663
viewsUser has exceeded the 'max_user_connections' Resource (Current value: 4)
I have a problem regarding open connections in the database, where error is occurring if the application tries to create more connections than the limit. Assuming the application creates and closes…
-
2
votes2
answers316
viewsInsert record into bank inside a for using Hibernate
I need help, I’m trying to create a fixed expense launch. I have to insert for example 12 records in the database, through a loop inside the for. To enter the data I am using Hibernate, however it…
-
2
votes3
answers438
viewsClose in Transaction with Ibernate
Hello, I need some help. I’m trying to make a transaction on Ibernate. The problem is that by giving a close, the data are modified in the database, but this occurs WARN: WARN…
-
2
votes1
answer286
viewsCriteria Bringing Duplicate Hibernate Data to JSF
I am receiving duplicate data or sometimes missing data until, how can I solve? This is my DAO: public List<Produto> filtrados(Filtro filtro) { try { Criteria criteria =…
-
2
votes1
answer65
viewsRegistration with Validation
currently my system has Person and Time, a person can already create a Time, defining some attributes(name and passwordTime). Now, I aim to create a "Join Team" method where someone will join an…
-
2
votes1
answer91
viewsSlow opening of Jframe with Hibernate
Good morning to all. I have a Swing application that has a Jframe using Hibernate 3 for networked Mysql BD persistence. When I run through Netbeans, it opens very fast. But when I run the jar built…
-
2
votes2
answers2921
viewsHow to resolve JPA Hibernate error
You can help me with this mistake? Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named bsewebservicePU at…
-
2
votes1
answer397
views@Onetomany without Primary Key
There is the possibility of making a relationship @OneToMany without Primary Key on the daughter table? Follow my two entities. Entity Noticia: @Entity @Table(name = "NOTICIA") @NamedQueries({…
-
2
votes1
answer265
views -
2
votes0
answers162
views -
2
votes1
answer389
viewsWorking with Javaweb Dates
Hello, I am doing a project that manages all projects of my company, I am using Hibernate, Javaweb, primefaces, TDD and MVC standard. My entity is shaped like this for date variables:…
-
2
votes1
answer41
viewsHelp with Broken pipe
Guys, I have a problem in my system, it is falling too much the connection as database, this system gets to 12 hours idle, I need a help to configure C3P <!--Configuração do pool de c3p0 -->…
-
2
votes0
answers39
viewsTable not found HIBERNATE
I was doing some tests with Hibernate using abstract classes to create a kind of inheritance and generate my DB from the classes, but I got a problem trying to persist. The case is, I have an…
-
2
votes0
answers197
viewsHibernate JPA locks
When you run persistence to create tables in the database netbeans hangs the exits on this item Oct 26, 2016 3:11:05 pm org.hibernate.dialect.Dialect INFO: HHH000400: Using dialect:…
-
2
votes1
answer360
viewsHow to search for ID’s in the bank and display the names on the screen?
In my JSF + Primefaces project, I have the following entities: @Entity @Table(name = "geracao") public class Geracao { @Getter @Setter @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private…
-
2
votes2
answers333
viewsDelete data with the @Manytoone interface
How do I delete data with the interface @ManyToOne? It does not give error, but does not erase the data in the database. My class Pedido: public class Pedido extends GenericDomain{ @Column(nullable…
-
2
votes0
answers1328
viewsError: could not Extract Resultset
I have this method: public List<AvaCriterio> getList(){ List<AvaCriterio> lista = null; try{ Session session = HibernateUtil.getSessionFactory().openSession();…
-
2
votes1
answer365
viewsWhat is Optimistic JPA Locking Field
What is and what is the "Optimistic Locking Field" of JPA? I noticed that there is this option for Eclipse Link and Hibernate and this function is enabled when annotating a version attribute within…
-
2
votes1
answer38
viewsCorrect creation of tables
Given my classes where Encomenda inherits from Objeto: @Entity @Table(name = "objeto") @XmlRootElement(name = "objeto") @XmlAccessorType(XmlAccessType.FIELD) @AllArgsConstructor @NoArgsConstructor…
-
2
votes4
answers1921
viewsHibernate does not create table automatically in mysql
I’m studying Spring with a little hibernate, where I stopped in a situation I can’t pass. I configured the code with Hibernate for creating tables in the database but when I run the application it…
-
2
votes3
answers572
viewsHow to map an entity with a composite key using JPA?
@Entity @Table(name = "USUARIO") public class Usuario implements Serializable { @Id @GeneratedValue(strategy= GenerationType.AUTO) @Column(name = "ID") private Long id; @Column(name = "USER_NAME",…
-
2
votes1
answer794
viewsHibernate does not find mysql JDBC "Driver" class in Maven project
Hello guys I created a Maven project in eclipse (with WAR packaging) and imported the packages of models already mapped from another project, soon after I created a class to "load" a persistence…
-
2
votes0
answers237
viewsProblem in left Join JPA - JPQL
Exception in thread "main" javax.persistence.Entitynotfoundexception: Unable to find CNPJ with id 00001388000307 Reading the documentation, I saw that this Exception is released when it tries to…
-
2
votes0
answers280
viewsManytomany Hibernate error
Hello, I have a relationship @ManyToMany bidirectional between the class Pessoa and Endereço, where for these, I have the tables in the bank for person, address and the table for the relationship…
-
2
votes0
answers1149
viewsCould not read Entity state from Resultset Entitykey Onetomany composite keys
I’m having trouble in oneToMany relationship of two entities using Jpa Hibernate. I have two tables, one for cancellation and another that has the orders that are part of the cancellation. The…
-
2
votes2
answers12692
viewsError Creating bean with name 'entityManagerFactory' defined in class path Resource
Good night, I have an application using Spring boot 1.5.10. I’m trying to make the connection to the oracle database, but I always have this title error. Attempts: I went back to the spring boot…
-
2
votes1
answer60
viewsYou’re not creating with "persist"
SEVERE: Servlet.service() for servlet [Spring MVC Dispatcher Servlet] in context with path [/cq] threw exception [Request processing failed; nested exception is…
-
2
votes1
answer291
viewsError deploying with Tomcat 7
I made an app with springboot and when I run it inside the springboot it works normally but when I run War and I put to run in Tomcat it gives some errors. I’ve tried a few things I’ve seen on the…
-
2
votes0
answers37
viewsDynamically connect to an Oracle database with each JAX-RS request
I’m developing a project on Jboss Seam to provide some services via JAX-RS on Wildfly 9. The DBMS used is Oracle 10g, and the services that will be made available are form features that the company…
-
2
votes1
answer135
viewsNative query count does not return the same type in SQL Server and H2
Hello, I have a native consultation that makes a simple count of records from a table: public Long contar() { String sql "SELECT count(*) FROM Order"; Query query = query.createNativeQuery(sql); //…
-
2
votes1
answer204
viewsLoading Lazy in Datatable of Primefaces does not bring the record data
I got a shipment lazy in DataTable of Primefaces, and in this table I upload I want to edit a record. Clicking on the line will open a dialog with a form for editing that record. But clicking on the…
java hibernate jsf-2.2 primefaces-5.2 java-ee-7asked 6 years, 3 months ago Raimundo Almeida Matos 35 -
2
votes1
answer126
viewsJPA returning Object different from class object type
The following query returns java.lang.Classcastexception: [Ljava.lang.Object; cannot be cast to br.com.satisfacer.model.Client public List<Cliente> teste(Cliente cliente) { return…
-
2
votes1
answer193
viewsHow to reduce JSF application CPU consumption
From a while ago, my application started to have a very large CPU consumption. I installed Jprofiler, and from what I understand from him, there’s a problem with the c3p0 from Ibernate. I am using…
-
2
votes0
answers42
viewsDifficulty with JPA annotations for entity relationships
I have the following relationships: Categoriapeca, Subcategoriapeca and Peca. One Categoriapeca may have several Subcategoriapeca, and a Subcategoriapeca may have several Categoriapeca, a piece can…
-
2
votes0
answers110
viewsHibernate does not consider field for Insert
I have a class Cliente which has composite key: @Entity @Table(name = "Clientes") @IdClass(ClientePK.class) public class Cliente implements Serializable { //@EmbeddedId //private ClientePK…
-
2
votes2
answers66
views -
2
votes1
answer313
viewsLazy Load in Hibernate
I’m not getting Lazy Load to work in Spring. I have the following structure. //Livro.Java @Entity public class Livro { @JsonInclude(Include.NON_NULL) @Id @GeneratedValue(strategy =…
-
2
votes1
answer132
viewsHow to map a Map in Hibernate
I’m trying to map a diary to an apprentice, where in the diary I have a Map<data,mensagem>, that is, the date that was created and its respective message, but with the mapping that I did, I…
-
2
votes1
answer325
viewsEnum error with JPA + Hibernate
When performing a query in the database with JPA + HIBERNATE the following exception shall be made: java.lang.IllegalArgumentException: Unknown name value [Respondido] for enum class…
-
2
votes2
answers2620
viewsHow to resolve? No converter found capable of Converting from type [java.lang.String] to type [@org.springframework.data.jpa.Repository.Query]
So Guys I’m having a problem when performing a query through a @query, well basically what I need is a list of a status column in the bd that returns only students who are with the status "Finished"…
-
2
votes1
answer1387
viewsSpring Boot, ultilizar outro campo de busca além do @id
I am making an API with Java with Spring boot and I would like it to search for CPF and not ID; http://localhost:8080/pacientes/ID http://localhost:8080/pacientes/Cpf (sera informado pelo usuario)…
-
2
votes1
answer1199
viewsHow to Map One to Many Correctly in Hibernate
Good afternoon, I am creating a very simple Restful API that implements an online course system, where I have only 2 tables "Courses" and "Teachers" (And I am trying to learn Latin in the process):…