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
votes1
answer297
viewsHow to list users and their "Roles"
Hello! I need to list the level of user access on my User Query page. But I can’t access Role data through User. The User entity has the Role attribute that is mapped with the Manytomany annotation,…
-
1
votes0
answers144
viewsJPA does not update children record
I have a little problem with JPA which is the following, I have the class ModeloEstoquePecas, where theoretically I need to delete everything first, which are the children’s records of the class…
-
1
votes1
answer3293
viewsIllegal Attempt to map a non Collection as a @Onetomany, @Manytomany or @Collectionofelements
Good night. I have the following mistake in Hibernate: org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements:…
-
1
votes0
answers328
views -
1
votes1
answer219
viewstenant application for multiple users
Well my doubt and while the approach of creating a database in the following scenarios Multiple Database, a user-created database Multiple Schemas, well would have only a single database, but each…
-
1
votes0
answers88
viewsRollback to persist entity with Hibernate
I have an entity Product: @Entity @Table(name = "produto") public class Produto implements Serializable { private static final long serialVersionUID = 1L; private Long id; private Cliente cliente;…
-
1
votes1
answer180
views -
1
votes1
answer36
viewsPass jTextField value to Namedquery
I have some jTextfFields where I need to send to the DAO their values, these values are arriving correctly in the DAO, but the return of NameQuery is being null. There is no mistake, only the return…
-
1
votes1
answer470
viewsHow to cascade relationship?
I have a class mapped with Hibernate, however, when saving an object is cascateado the whole object to the child table (what is expected). The problem is that equal objects are saved instead of just…
-
1
votes1
answer100
views -
1
votes1
answer60
viewsFor don’t go through the whole list
I’m having a problem going through a list. Man for this way: for (int i = 0; i < listaCaixaAbertos().size(); i++) { listaCaixaAbertos().get(i).setFechado(Boolean.TRUE);…
-
1
votes1
answer311
viewsReason for delay of process and configuration of Hibernate (persistence)
I’m setting up a WS server with Java, and I’m seeing some problems, like login via POSTMAN, is taking between 6000 to 7500 ms to respond, and what it really does, is around 50 ms. After being able…
-
1
votes0
answers83
viewsIs there a restriction to consult using inheritance in Hibernate?
Good morning/afternoon/evening Gentlemen. The situation is as follows. I have a query that performs the registration of daughter entities aiming to divide the object. However at a future time the…
-
1
votes1
answer212
viewsDatasource configuration
I am with a java application running on wildFly 8 and using Sql Server, the problem I am going through at the moment is that comes a moment the application returns me saying that I could not open…
-
1
votes1
answer754
viewsShow output from a JSP page Servlet list
I need to capture an input name, query the database and return the result on a jsp page. I want to show the result in a short snippet of the JSP page, in case I mix the text of the JSP page with the…
-
1
votes1
answer459
viewsProperly manage database connections using Hibernate
What would be the best standard for connections, I thought of two modes : Mode 1 : Each function creates and closes its own connection Insert function' EntityManagerFactory factory =…
-
1
votes2
answers517
viewsUnderstanding the use of Generics in an abstract DAO Hibernate class
Hello, I am starting to develop a web application with spring+Hibernate framework, I started for an example that contained following class: import org.hibernate.Criteria; import…
-
1
votes1
answer313
viewsMap relationship between tables without Foreign key
I have two tables in postgresql: schema1.immobile idt_imovel | int cod_imovel | string nome_imovel | string etc... schema2.declaration idt_declaracao | int cod_imovel | string status | string etc...…
-
1
votes1
answer257
viewsPersistence in JPA Cascade
I’m trying to perform a cascade persistence using JPA. I have the entity: Course and Module 1 Course can have several Module @Entity(name = "course") public class Course extends BaseEntity { private…
-
1
votes0
answers239
viewsHibernate Query with setParameters
Hibernate is ignoring my data from a Map when it is void. If I’m with setParameter("nome",valor) and the value is null it works, does anyone know how to solve? Follow the code: public List…
-
1
votes1
answer245
viewsRelationship of one column to several
I have an entity class called Doctor, in which it has an Idmedic column. It relates to the class entity Care, which in turn has an Idmedico column, which would be a foreign key of this first. There…
-
1
votes1
answer460
viewsJasper with JPA connection
I’m in a Java Desktop project using JPA, just to send a few reports where I’m using Jasper. Reports have sql queries the user interface will only pass parameters for data filtering. I found it…
-
1
votes1
answer153
viewsError doing Many to Many interface with Spring Boot
I’m trying to make a phone call Many-to-Many between classes usuario and permissao, using the documentation of Hibernate as reference . But when I try to generate a class JSON file usuario the…
-
1
votes1
answer35
viewsJAVA Nullpointexception
by clicking on my button in the view the parameter is not arriving in my attribute java responsible for the button public Map<String, Object> getFiltroGlobalMap(){ Map<String, Object>…
-
1
votes0
answers139
viewsJson, Hibernate, Spring boot
I’m having two situations that should do the same thing but don’t: package com.example.demo.entity; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import…
-
1
votes1
answer64
viewsPass JSP Objects with Hibernate
Expensive, I have the classes below. I am having trouble creating a tree classification, because in JSP I am passing the parameters "Id Area" and "Tree Description", in the controller I am receiving…
-
1
votes1
answer387
viewsQuery with JPA filtering by Entity List
I’m performing a system in Java using Springboot and JPA, being event management and have two entities: Inscricao and HorarioAtividade. They have a relationship Many To Many, with my class Inscricao…
-
1
votes2
answers592
viewsSpring Modelling JPA Person -> Personal Modelling -> Function
I did the data modeling (UML) but at the time of implementing I’m doubtful how to do. I wish there was only one table Person. In that table person I would have the field tipoPessoa("p","f") and…
-
1
votes1
answer264
viewsError Performing load command : org.hibernate.Objectnotfoundexception: No Row with the Given Identifier exists
Good afternoon! Loading a list from the Archive entity: org.hibernate.event.internal.DefaultLoadEventListener doOnLoad INFO: HHH000327: Error performing load command :…
-
1
votes1
answer93
viewsHibernate no Excludes
Good night, you guys... I’m learning hibernate and I had a problem: I was able to insert, retrieve the BD data... I had a setback that I fixed by adding the following command line in the execution…
-
1
votes0
answers98
viewsClass Relationship with Primarykey Composite in Hibernate
I have the following relationamento In the Definition Scale entity I have a composite primary key composed of idEscalaDetailing and idTurma I’m having doubts to do the reverse mapping between…
-
1
votes1
answer1238
viewsJPA error with Mysql 8
Hello, After updating my database, my application has been presenting exceptions, like java.sql.Sqlsyntaxerrorexception. The class below is the one he complains about, saying it doesn’t exist when…
-
1
votes1
answer156
viewsError generating Id automatically in Hibernate
I am making an application with Hibernate, but is generating and error: "ids for this class must be Manually Assigned before Calling save()" The class that’s saying you’re wrong is like this..…
-
1
votes1
answer536
viewsNo Persistence Provider for Entitymanager named
Guys I’m studying about the Ibernate framework with JPA in a simple example of guy I’m already having problems and my research did not take me anywhere to solve my problem. that’s the mistake you’re…
-
1
votes2
answers682
viewsError while trying to connect to a Postgresql database with Hibernate and Spring Boot
I’m a beginner in Spring Boot and Hibernate, I did a project on Spring Initializr only with the dependencies Web, DevTools e PostgreSQL, but then I added dependency spring-boot-starter-data-jpa, I…
-
1
votes1
answer53
viewsDo not re-enter an existing login user
I have a JPA problem with Java. I built a login system, using a self-generated ID, but every time I run the program it creates another user in the database, with a different id but same credentials.…
-
1
votes1
answer36
viewsEntity attribute based on a field from another table - Hibernate
I have a microservice raised using Spring, Restful and Hibernate. I would like to know how I can modify an attribute of this json microservice, based on a condition, obtained through a query to the…
-
1
votes1
answer408
viewsError passing a Thymeleaf object to the Spring Boot controller (post)
I have this controller: @PostMapping("/salvar") public String salvar(@Valid OrdemServico ordemServico, BindingResult result, RedirectAttributes attr) { if (result.hasErrors()){ return…
-
1
votes1
answer179
viewsRemove method does not work, nor returns error
My method remove does not delete the record on BD. And, worst, returns no error, nor executes the query (except for Select, I think it’s normal). I used the prints to know if the object was arriving…
-
1
votes0
answers121
viewsHow to create a Generic method that takes any entity class, and starts a session in Hibernate?
Good night, I am trying to create a method that receives any entity class and an ID to start a session on Hibernate. The idea is to make a Generic DAO to take only the ID of the entities I want.…
-
1
votes2
answers874
viewsJava: create Inner Join using criteria
I’m having a hard time finding good examples of how to create a query criteria using Inner Join. I created the query below that would be what I would like to do with the criteria. SELECT DISTINCT *…
-
1
votes2
answers85
viewsJPA Hibernate with Postgres - 2 transactions
I started using Hibernate 1 month ago. I am developing a simple application from bank to college. I have an account class, which has the Withdraw Value method : public boolean SacarValor(long…
-
1
votes1
answer122
viewsThe Annotation @Persistencecontext is disallowed for this Location
I’m getting the message "The Annotation @Persistencecontext is disallowed for this Location" when I try to put this annotation in the code, someone knows how I can fix it? @Stateless public class…
-
1
votes1
answer142
viewsPsqlexception: ERROR: target lists can have a maximum of 1664 entries
I am trying to persist an object in the database but I get this error: WARN: SQL Error: 0, SQLState: 54000 ERROR: ERRO: listas de alvos podem ter no máximo 1664 entradas Advertência: A system…
-
1
votes1
answer108
viewsMapping with Inheritancetype.JOINED Does not work
I’m trying to solve a college activity where specifications were passed to map the classes with JPA. I have the following inheritance to map: Employee (parent class), Seller (daughter) and…
-
1
votes1
answer721
viewsHow to create a @Onetomany relationship in JPA, in 3 tables that already exist in the database?
I want to create a relationship @OneToMany in JPA using 3 tables I have already created in my database (I don’t want it to create the tables for me), the tables are Usuario, Perfil and…
-
1
votes2
answers248
viewsNull return for a JPA method
I have a method in my Pository that searches for a specific user’s last minute and a specific date as well, both passed as argument. However, if there is no record on the last date it returns null…
-
1
votes0
answers106
viewsDatabase cache not being stored by Springboot
I am trying to store the cache of a database search made through JPA, for that I am using the annotation @Cacheable of the package org.springframework.cache.annotation upon the method…
-
1
votes1
answer190
viewsHibernate can’t find an existing column, ERRORCODE=-4460
I am having a difficulty in my system where SQL with Hibernate can not find a specific column by Java, the same query returns the right result when rotated by SQL. IDE used is Netbeans. The query is…
-
1
votes1
answer76
viewsReturning only the last value of a table and filling a collection via JPQL
I have the following tables in the database: CLIENT ID | NAME | CPF BUYING ID | DESCRICAO_ | DATA | ID_CLIENTE the CLIENT table with the columns id, name and Cpf the PURCHASE table with the columns…