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
-
0
votes1
answer847
viewsJava - Query Spring with current date
I have the following repository with the following method @Query("SELECT m FROM Money m WHERE m.data = CURRENT_DATE()") Money findTop1IfHasMoneyInCurrentDate(); My money class is like this: @Entity…
-
0
votes1
answer74
viewsProblem saving two sales at the same time - JAVA
I have a problem saving two sales at the same time on different computers, when it finishes both, one replaces the other. I am using @ManagedBean, @SessionScoped. This is my method salvar() in the…
-
0
votes1
answer233
viewsSpringboot with Hibernate and relationship between postgres tables in different schemas
I have the following problem: I created a database called Test and inside there are two schemas: schema1 and schema2. Within each schema has a table: schema1 -> Tabela1 schema2 -> table2 It…
-
0
votes1
answer179
viewsAutocomplete with New Registration option - JAVA
I have a autoComplete on the sales screen, when the user enters the customer’s name I want that if it has no record it displays something like "ADD NEW CUSTOMER", I’m wearing primefaces:…
-
0
votes0
answers70
viewsInsert/get multiple tables without Id
Good afternoon guys, I’m having a problem affecting me a few days already. The situation is as follows, I have a simple relationship: There are tables person, street, neighborhood, city, state,…
-
0
votes1
answer111
viewsNumber(3.0) field in Oracle database for Java
I have a table in an Oracle 11g database with a field of type NUMBER(3,0) In a Spring project, I own the following: @Repository public interface TipoPropriRepository extends…
-
0
votes1
answer116
viewsDoubt in JPQL/HQL query
I need to make an appointment in HQL and I have this entity Hibernate. @Entity @Table(name = "TB_TIPO_DOCT", schema = "FEP") @NamedQueries({ @NamedQuery(name =…
-
0
votes0
answers97
viewsI can’t solve No Persistence Provider for Entitymanager named
I searched on various forums, made all the suggestions I could find and still could not solve. I don’t know if it’s because of the archetype of the design, but it’s the pattern I’m using. Can…
-
0
votes0
answers322
viewsjavax.servlet.Servletexception
I’m doing a basic user registration with Servlet. When I click on the sign up button I get the following error page (everything has been revised and is in perfect working, I believe it is something…
-
0
votes0
answers31
viewsHibernate are not generating tables in the Mysql database
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" …
hibernateasked 6 years, 2 months ago Alexsandro Santos 1 -
0
votes0
answers36
viewsError deploying a java application with postgres
Expensive. I created a small web application using postgres. However, when I run the eclipse, it runs smoothly. But when I export the file. War and try to deploy on Tomcat server, it returns me the…
-
0
votes1
answer140
viewsHow to display objects from a list?
I have the Personal class which has the following method: public List<Pessoa> BuscarTodos() { List<Pessoa> list = null; EntityManager em = getEM(); try { list = em.createQuery("select t…
-
0
votes0
answers82
viewsHibernate 5.1.16.Final + MSSQL + Java7 + C3P0
I am successfully using Hibernate to consult a MS SQL database, but I get the message that I should not use in production. Using Hibernate built-in connection pool (not for production use!) ....…
hibernateasked 6 years, 1 month ago Leandro Silva 93 -
0
votes2
answers692
viewsHibernate, JPA, does not save the new data in the database
I have a Java Spring MVC application, with Hibernate and JPA and HTML interface. I have two forms that depend on the Notebooks class and its attributes. In the first form I enter the data of a new…
-
0
votes1
answer88
viewsDoubt about foreign key Ibernate
insert image description here The diary_place table is being created with 2 user_id field, I want it to be only a user_id referenced as foreign key for Diary and place tables. I want the result to…
-
0
votes0
answers363
viewsAPPLICATION FAILED TO START: Persistence error while starting the application
Projeto Completo: https://github.com/codenome/ponto-inteligente-api I am developing an application with Spring Boot, and when starting the application I found an error that I could not solve after…
-
0
votes0
answers631
viewsSpring Data jpa save() method does not work, returning an object with nullid
Personal I have Rest Api developed with Spring, Hibernate and springboot, I am with a problem when making a post call to persist the data of a particular client, does not generate any error and also…
-
0
votes1
answer771
viewsGet the latest record by date from a mysql release history
I need to pick up the latest donation situation at a certain time. I need to group by donation and by situation. Add by situation and order donations by situation, taking only the last. Tabela…
-
0
votes3
answers1359
viewsHow to resolve ERROR: HHH000346: Error During Managed flush [org.hibernate.Exception.Sqlgrammarexception: could not execute statement]
When I try to run my test class I get this error below. I don’t know what else to do, when I comment on the attribute FOLDERAUTOUPDATE class ApplicationItv the insertion in the bank works, but I…
-
0
votes1
answer35
viewsAuxiliary tablet with composite PK
I have a supplier table: @Entity(name = "tbl_fornecedor") public class Fornecedor extends PessoaJuridica implements Serializable, Desativar { private static final long serialVersionUID = 1L; @Id…
-
0
votes2
answers520
viewsSelect List Item by "ID" using Thymeleaf and direct to another detail page
I’m trying to build an application using Springboot, Hibernate and Thymeleaf. I would like to take the "id" of the selected service in the list using Thymeleaf, search this service in the database…
-
0
votes2
answers492
viewsHow to save a list using Hibernate?
How to save an entire list using Hibernate? I’m trying to save a list this way: classe.setMinhaLista(minhaLista); classeDao.salvar(classe); And so: classe.setMinhaLista(new…
-
0
votes1
answer815
viewsHQL with case, sum and max
I’m with a query that is giving problem, I believe the problem occurs for not allow to use the function max, within the function sum, am I correct? How can I get around this? Because I need to add…
-
0
votes1
answer533
viewsDo I need to include classes mapped in persistence.xml? Java-Eclipse-Maven-Hibernate-H2database
I’m trying to set up a Maven project in Eclipse with Hibernate and H2 Database. So I’m trying to understand the persistence.xml settings, which I had to create. One question is: do I need to include…
-
0
votes1
answer259
viewsRestriction error in relationship Onetomany Hibernate
I’m getting error in the Onetomany relationship when I try to persist an entity. Error: org.postgresql.util.PSQLException: ERROR: null value in column "book_url_id" violates not-null constraint…
-
0
votes1
answer63
viewsQuery returns subclasses in Spring
I’m having trouble mapping the classes of a spring project I’m working on. I have the super class called Itempauta and the subclass Homologation. Pai Class @Data @Entity @Table(name="item_pauta")…
-
0
votes1
answer41
viewsInsert using Many to Many Annotation does not work
Hello, I have a Many to Many relationship between TEAM and NEWS. I am trying to create a method to insert a "NEWS". I am using Hibernate with Annotation to map the classes. The Insert works and…
-
0
votes1
answer27
viewsHibernate Does Not Create Schema Tables
What I realized is that Hibernate doesn’t seem to create tables the way they should be presented in the database. I’m using Mysql and realized the following: Example of the structure: Table Course…
-
0
votes0
answers26
viewsData migration postgresql reformulate table
The title may imply that I am recreating a table with similar attributes, but the term is as follows:: I have a database currently running in my application for study purposes, there is a class…
-
0
votes1
answer75
viewsHow to persist objects in a table if I don’t already have the foreign key?
I have a class of Equipment that has a Scheduling list. They are mapped like this: @Entity @Table(schema = "pesquisa", name = "sre_equipamento") public class Equipamento implements Serializable {…
-
0
votes1
answer49
viewsProblems declaring a foreign key using Ibernate
Hello.I need help declaring a foreign key using Hibernate in a project with JSF, I consulted several websites and handouts and could not find a solution. Where I have the classes already mapped…
-
0
votes0
answers95
viewsHow to stop a Session?
I am working with Java Swing. I have a report screen, which when it is clicked on the confirm button, it calls the generate method. The generating method goes in control, and the control goes in the…
-
0
votes1
answer508
viewsHow to return validation errors of subobjects, attributes(objects), lists, to spring?
Today I can validate attributes errors of my class that are not complex objects (other objects of my model that are related to it), but what happens is that the "validation bean" validates the…
-
0
votes1
answer44
viewsI cannot delete data from an entity
I have a method that deletes a company entity and its attachments, after the archiving of a protocol, however, when I try to delete, this happens: Caused by: java.sql.BatchUpdateException: Entrada…
-
0
votes1
answer71
viewsI am unable to list the data in the Mysql database using Hibernate JPA
**Classe: Estado** package entidade; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public…
-
0
votes0
answers29
viewsWhy is the data blank when changing a data in phpMyAdmin using Hibernate JPA? I am using Nextline
package loja; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; public class Loja { **Conexão: Loja** private static EntityManagerFactory loja; public static…
-
0
votes1
answer735
viewsHow to map a table without ID, using Hibernate annnotaions?
Hello, good morning, sir. Having a table that relates USER and ACHIEVEMENTS called USER_ACHIEVEMENTS, where it does not have ID, only USER_ID and ACHIEVEMENTS_ID, ie a manyToMany relationship. How…
-
0
votes1
answer86
viewsDatabase Query with an Array in Hibernate
I have a method that takes as parameter an array of values(id) and I need to do a query in the database to return only the rows of a column with these values(id) I have this method: public…
-
0
votes0
answers46
views(hibernate) Tables are created, but data is not inserted
I am trying to create and insert data into a table through Hibernate, but when I run the code no data is inserted. I have a medical class that inherits from the Employee class. Staff Class: import…
-
0
votes1
answer930
viewsJpa Hibernate does not create table in H2
Good night, I am new in Java development - Spring Boot and following a tutorial I can not generate the table in the H2 database, already tried to make some changes in the application.propreties but…
hibernate jpa spring-boot h2database spring-tools-suiteasked 5 years, 5 months ago JULIO CESAR SILVA DE FREITAS 23 -
0
votes3
answers140
viewsJPA+Hibernate: Error removing from an entity
I’m getting this Exception while doing the remove, already broke my head looking for what and Exception in thread "main" java.lang.Runtimeexception: Error Interpreting query [delete from Book Where…
-
0
votes1
answer49
viewsPaging and Research - Springdata with Sqlserver2008
Hello, I have a problem in my application and I wanted to see if anyone here can assist me. I’m developing a system with Springboot (Springdata, etc. ) on top of a base Sqlserver2008. Due to force…
-
0
votes1
answer190
viewsDoubt about Hibernate heritage
I have 3 classes / 2 tables: employee / secretary : Functionary salesman employee extends secretariat extends staff i wanted to make a single table inheritance with seller and employee and an…
-
0
votes1
answer54
viewsProvided id of the Wrong type for class - [JPA] Embeddableid formed by another Embeddable
On the bench I have two tables called Table and Tabub. To Table is composed of a primary key, which is composed of 3 attributes. To Tabub is composed of a primary key, which is composed of 3…
-
0
votes1
answer28
viewsQuestions in relationships Ibernate
Could someone ask me some questions about Ibernate? Good have 2 product and sales tables with a n:n relationship that generated an item_sale table I did it in my two models to map: Class Products:…
hibernateasked 5 years, 3 months ago Joao Spirit 101 -
0
votes1
answer185
viewsHelp with Spring jdbcTemplate
I created a class: package com.market.config; import javax.activation.DataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;…
-
0
votes1
answer130
viewsRelationship 1:N in Java
I have an API and I’m creating a relationship between Cliente and AtividadeSecundaria, where a client has several activities and the activities belong to a client, however, when I make the…
-
0
votes0
answers35
viewsHibernate error while reading database column (Reverse Engineering)
When I try to reverse-engineer Hibernate, he can’t read the comic book columns. Give this error "Reading Schema Error: Error while Reading column meta data for curso" Does anyone have any idea what…
-
0
votes1
answer71
viewsHow to reference a data already existing in the table with Hibernate
I’m creating an api using Java with Springboot, and Ibernate. The idea is to save guests in the database, and these guests have a group, I don’t really understand the notes, but Mapeei with…
-
0
votes1
answer194
viewsSend by jsp a command for the controller to update the database method
I want to make a "deposit" into the account with Id "x". The controller sends the "account" to the jsp that returns the deposit value to be updated in the database. That was the logic I used, but I…