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
answer448
viewsHow to filter selected fields through Spring JPA using JPQL?
I would like to know how to proceed to filter selected fields using JPQL within the JPA/Hibernate implementation? The following scenario will be presented to facilitate understanding, following…
-
1
votes2
answers83
viewsselectOneMenu with convert does not work
I have a selectOneMenu where I am populating with the database data but the same is coming with the memory address (see image), and not the value I want. I tried to solve using the example of this…
-
1
votes0
answers167
viewsJava Pool Hibernate c3p0
Dear friends, good afternoon. I have a Java solution that’s generating production problems, taking down the bank. After a few changes, I set up a pool using Hibernate c3p0 to manage the number of…
-
1
votes1
answer21
viewsHibernate Table replication with Quence
Good Afternoon, In an application I am working on we have a table called tb_perfilparametrovalorpdv, following the mapping @Data @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @Entity…
-
1
votes1
answer103
viewsProblem with JPA Hibernate
I have a problem in a system that I am developing using springboot together with JPA Hibernate. I’m not so experienced using them, so forgive me in advance. Let’s get to the problem: I have 2 tables…
-
1
votes1
answer52
viewsHow to get around the use of reserved database words with Hibernate?
I am learning to work with REST API in Java using spring with Hibernate and I have the following problem. My entity has the name user which is a reserved word in the database I’m using(postgres), so…
-
1
votes0
answers32
viewsError in performing criteria with filter on object belonging to Composite ID
An error occurs when I try to search the Car domain class by applying a filter on the Mark which is a FK and is part of the Composite ID. class Carro implements Serializable { Marca marca LocalDate…
-
0
votes1
answer260
viewsDetected an untreated exception. Generated code: [68MJGTMV] and [XJEL5QC6] - Expected exception
Caught an unhandled Exception. Generated code: [68MJGTMV]: javax.faces.Facesexception: #{classeBean.save()}: I checked the specified class that expect an Exception value, but it doesn’t. The problem…
-
0
votes1
answer254
viewsIs there such a thing as nhibernate Fluent for java Hibernate?
I know that fluent nhibernate(Hibernate version for . net) uses lambdas and that java just implemented now in version 8. But there is some form of configuration of hibernate of java through code?…
-
0
votes1
answer400
viewsOverwrite Primary Hibernate Key Generator
I would like to know if you can overwrite the generator of a primary key in Hibernate, in my case I make a superior class where the id, and the rest extend from her. In my case this subclass, which…
-
0
votes1
answer276
viewsProblem with class org.hibernate.Validator.Invalidvalue when upgrading from Hibernate 3.X to 4.X
I have a project developed using Jboss Seam 2.2.2.Final along with Hibernate 3.6. I’m trying to upgrade this project by upgrading and migrating the component versions that it uses. One of these…
-
0
votes1
answer76
viewsPreventing entries from being deleted using Hibernate
Is there any way I can set that certain table entry in the database is not excluded? For example, I created a table usuários on the bench through the class User using the annotations of Hibernate…
-
0
votes1
answer194
viewsError showing List output using MVC and JSF
I need to return data from the database to JSF but even before I get to JSF I cannot show the searched data. I Have Next Mistake: Advertência: #{usuarioBean.pesquisa}: java.lang.ClassCastException:…
-
0
votes0
answers88
viewsInserting records into the database only after the insertion into a List
I do not know if I was very specific in the title, but I will try to be more in the description. I have in my database a table of Disciplines that contains: id name workload I would like these…
-
0
votes0
answers142
viewsLocking system after image upload
People in my system, I upload a certain image, the image is saved in a directory and then saved the product in the bank, until then certain td, the problem is that after saving the product the…
-
0
votes3
answers137
viewsPostgresql Query - How to do this?
How to make an SQL query in this table: ID Col2 Col1 -- ---- ---- 11 1 A 12 2 D 13 3 G 14 1 B 15 2 E 16 3 H 17 1 C 18 2 F 19 3 I To return this result: 1 A B C 2 D E F 3 G H I Is that even possible?…
-
0
votes0
answers117
viewsProblem to save with Hibernate, verified type is different from expected
I’m having a problem saving two tables (@OneToOne) in the bank using Hibernate. Using weak relationship entities (person, address). Errors shown on console: Initial Sessionfactory Creation…
-
0
votes1
answer208
viewsQuery in HQL using Hibernate
How to do a query to return the result below in HQL Upshot | quantidade | quantidade erro | desc | | 2 | 1 | TESTE 1 | | 3 | 2 | TESTE 2 | | 1 | 1 | TESTE 3 | Table | DESC | ERRO | | TESTE 1 | 0 | |…
-
0
votes1
answer99
viewsChange of entity reflect on related entities
I have two entities, for example: Note: Fictional code to facilitate understanding of the problem. @Entity public class Celular{ @Id @GeneratedValue(strategy= GenerationType.IDENTITY) private int…
-
0
votes1
answer50
viewsProblem with Like for Criteria
Good morning. I have a table in the following format: I need to select to return the sum of infrastructure values grouped by year. I created this query in SQL: select YEAR(dataCompraInfra),…
-
0
votes1
answer78
viewsNullpointexception to set value from Converter
I have an application where I need to calculate data from a certain relationship. When usuarioController.view == 3, is defined as a Login for Usuario and a Plano (already persisted) to Login so that…
-
0
votes1
answer106
viewsError in Embeddedid
I have the composite key below, the problem is that when creating the schema and save the values, Hibernate is reversing the values of TipoContrato with Distribuidora and vice versa. Someone has…
-
0
votes1
answer185
viewsOrder By Hibernate in JSF
Hello, good afternoon, I am a beginner in this web world and I need to order establishments by punctuation (the best punctuated at the beginning, LOGICAL) The mistake is An Error Occurred:…
-
0
votes1
answer254
viewsHow to do a random search using JPQL script in JPA2
The idea is basically to search for an X number of entities persisted randomly, and these entities cannot be repeated. The question is, is there any way to perform this type of search by creating…
-
0
votes2
answers345
viewsHow to translate the Mysql query that has a sum to Hibernate?
I need to translate the following query from Mysql to Hibernate: select sum(TOTAL_MERCADORIA_BRL) from PROCESSO group by PERIODO like 'DEZ-15'; What would be the best way to do this query, but using…
-
0
votes1
answer295
viewsTrouble with Hibernate
I’m trying to learn about Hibernate together with a tutorial making an app for a petshop and I’m having the following problems: INFO: HHH000228: Running hbm2ddl schema update dez 16, 2015 8:34:52 PM…
-
0
votes1
answer59
viewsHow to persist the value returned by a method?
In a class that has a collection, I need to persist the count of collection elements that follow a certain condition. Therefore, I need to save the result of a method that checks all elements of…
-
0
votes0
answers425
viewsJava error: javax.servlet.Servletexception: javax/Enterprise/context/spi/Contextual
I’m new to Java and I’m having trouble showing on the page a grid with data from a database table. I am using java + Hibernate + JSF 2 + Tomcat 8. When I run my xhtml page it presents the error…
-
0
votes0
answers40
viewsNo Session found for Current thread
I am having trouble performing a test to add a user with profile! My problem is the method addUser. Code of the test class: public class AddUser { public static void main(String[] args) {…
-
0
votes1
answer152
viewsHibernate shows ddl but does not create tables in the database
When starting wildfly I expected the tables to be created in the database but in the console shows a log of create Tables but nothing happens in the database. Below I show it: 14:15:00,462 INFO…
-
0
votes0
answers212
viewsError deploying to Heroku
Trying to deploy to Heroku with Tomcat 7 and Hibernate and this error appears: [ERROR] Failed to execute org.apache.Maven.plugins:Maven-Compiler-plugin:3.1:Compile (default-Compile) on project…
-
0
votes0
answers260
viewsuser editing screen does not load data, and delete method does not delete
Take a look at the codes: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"…
-
0
votes0
answers380
viewsIdentify user by login
Hey there, guys. I am developing a system that deals with user registration and I have the following problem: in the system there will be 3 types of users: Administrator, Normal and Temporary.…
-
0
votes0
answers94
viewsProblems with foreign key
Hey there, guys. I am creating a system that controls user registration and I have a problem regarding a foreign key that is imported from another class into the Users class. When I change the state…
-
0
votes2
answers2498
viewsProhibit duplicate registration
Hello, guys. I’m with a program that works with user registration. In this program I would like to implement a function that prohibits the registration of Cpf or email that already exists in the…
-
0
votes1
answer45
viewsProblem with Hibernate at the time of lodging
I have a webservice that works perfectly on my machine, I use mysql and Hibernate. I’m getting a lot to do hosting on Integrator.com.br, gives DNS problems etc. The main problem is, when running the…
-
0
votes2
answers74
viewsProblems to generate SQL command
Hello, everyone. I am creating a project that handles user registration. In this project there will be several types of users. To simplify, let’s call the types 1,2 and 3. Depending on the type of…
-
0
votes1
answer33
viewsConsultation Entity without its Associations
I’m creating an app with JAVA SE + HIBERNATE. I am having a "problem" in making a query to a single Entity. Then, it would be possible to make a query in the entity(TABELA) without the relational…
-
0
votes0
answers211
viewsProblem with hibernation and JPA
It’s a WS REST, he should return a donor, but he’s making an exception... Console: set 22, 2016 3:37:15 PM org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {5.0.1.Final} set 22, 2016…
-
0
votes1
answer76
viewsHibernate returns many queries and overwrites my changes
Good afternoon guys, I am trying to make a change in a datatable, when clicking on rowEditor, the value is sent correctly, however, I do not know why, It is being held many queries with Hibernate. I…
-
0
votes1
answer129
viewsHibernate with dynamic table names
Good Morning/Afternoon/Evening Staff! in a scenario where a comic table must have a concatenated name and dates as this would look with Hibernate given that the base name is annotated in the model.…
-
0
votes2
answers854
viewsPut default value in column
I need to leave a default value in this table column, I am mapping the Persistances with Hibernate (summarizing the database is created according to the HQL/JPA I define in Omains. How do I set a…
-
0
votes2
answers4617
viewsQuerysyntaxexception: Unexpected token: . near
This is the mistake I believe is easy for those who know Java but as I am learning I have not identified the problem. GRAVE: java.lang.IllegalArgumentException:…
-
0
votes1
answer57
viewsSearching for data in another database Schema using createQuery
In postgres, we can search for data in various schemas through sql itself. Doing so: SELECT * FROM meu_schema.minha_tabela It is possible to do this using the createQuery? By default, my application…
-
0
votes1
answer2919
viewsHibernate does not recognize class annotation
I have a Maven project, with Glassfish 4.0, Hibernate, I am using annotations and my project was faceted with JPA the persistence.xml file was generated and the Glassfish Connection pool is working.…
-
0
votes2
answers89
viewsJava code causes persistence problem
After adding the following lines to my Metadicas.java class, a persistence problem arose that was not there before: Lines added: @OneToMany(cascade=CascadeType.ALL) @JoinColumn private…
-
0
votes3
answers109
viewsValue is not being written to the bank
I have the following entities: package br.com.pokemax.modelo; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import…
-
0
votes0
answers161
viewsError creating Springmvc bean
I’m new in Java and I’m doing several online courses and trying to develop on my own, to train, but I came across a mistake that I have no idea how to solve. Error creating the bean:…
-
0
votes1
answer2562
viewsTarget Unreachable, Identifier 'usuarios' resolved to null
My bean: package com.cliente.Bean; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import…
-
0
votes1
answer120
viewsError searching for data in Jtable with Hibernate
The following error of when searching the data: INFO: HHH000182: No default (no-argument) constructor for class: Classes.Funcionario (class must be instantiated by Interceptor) Hibernate: select…