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
votes0
answers97
viewsPerform Hibernate mapping (Annotations) of foreign key being also the primary
I want to carry out the mapping in the standard Hibernate Annotations of my class, being the one-to-one relationship between the tables, and the primary key of one is foreign and primary in the…
-
1
votes2
answers106
viewsHibernate: Increment from a specific value
I created an attribute like Integer called registration and want that, when the user is to register, the value of this registration is generated automatically and saved in mysql from a certain…
-
1
votes1
answer340
viewsProblem with @Autowire Spring + Hibernate and Junit
Good evening, I’m trying to create a project using Hibernate and Spring, I was successful creating some configurations, including I was able to generate the database by booting the application using…
-
1
votes1
answer71
viewsSet ID manually with Hibernate in AUTO mode
Hi, I was wondering if there is a possibility to set the ID manually when using Hibernate in auto increment mode. I want it to use auto increment but in some specific situations I need to query the…
-
1
votes1
answer1049
viewsConfigure Sessionfactory Hibernate 5.2
Does anyone know of any tutorial or can you give me an example of configuration for Hibernateutil.java class for version 5.2 of Hibernate? I’ve seen some settings, including in the documentation.…
-
1
votes1
answer314
viewsMapping the same entity class to two banks
Good afternoon Earthlings, I am a beginner in java and I have the following situation. I have two databases, where I will transfer the records from one database to the other. There is the…
-
1
votes0
answers619
viewsJSF Download File Saved in Database
Hello, I have a jsf page where I upload the data from a entidade, between the data there is an attached file (pdf, xls, jpg etc.). I would like you, when clicking on the file name, to download the…
-
1
votes0
answers89
viewsproblems with @Injection
Hi, guys. I’m creating a program that manipulates human and livestock records. In this program, on the livestock register screen, I am creating two Selectonemenu of the first faces. One is of type…
-
1
votes0
answers72
viewsSaving whole object instead of name only
Hi, guys. I’m having a problem storing livestock records at the bank. The situation is as follows: I have two Selectonemenu on my screen where one is dependent on the other. One is to indicate the…
-
1
votes0
answers55
viewsListview with Hibernate 3 no population
I have the class below, the method listGeneroTreeView(), captures the values I have in the bank. However, I am not able to display this data on treeview. I just know it works for a message I put in…
-
1
votes1
answer1831
viewsSending of sms by Java
Speaking personally, I am developing a financial application that I was asked to send a text message to the main administrator. I’m using Java web, Mavem,jsf, Hibernate. Could someone give me a…
-
1
votes1
answer125
viewsHibernate saves twice the entity executed within the primefaces dialog
When the save button is on the page it works normally and saves the entity but I open a dialog to confirm the data to be saved and Hibernate saves twice very strange method to save outside the…
-
1
votes1
answer52
viewsQuery with jpa + Hibernate with more than one idt in clause
with Hibernate I can make an inquiry by idt as follows: entityManager.find(Empresa.class, idtEmpresa); And that would already return the mapped object of the company class, but what if I wanted to…
-
1
votes1
answer1878
viewsValidate date less than current date
My question is as follows. I have a JSP form for the registration of students with several attributes, one of them is the date of birth. Until then I was registering the date only validating the…
-
1
votes1
answer303
viewsJava Test with database in memory
I am in doubt when running the tests of my application: The question is whether there is the possibility of making Hibernate create a non-physical bank to perform the tests in memory, to facilitate…
-
1
votes1
answer190
viewsSQL: Record counter with grouping of data from different fields
I’m having a hard time building an SQL. have a table addressee with the strings fields street and crossing. I need to count the numbers of records that have the same crossing and group them Example:…
-
1
votes1
answer186
viewsSelect Hibernate criteria with mapped entity
has how I make a select, using the criteria and bring an uncharted entity, would be several joins, and sometimes bring certain fields and others not.
-
1
votes2
answers264
viewsSession Hibernate, how to obtain instance
In all the Hibernate documentation, and web-based examples have this code example, or a very similar one, to use Hibernate. List<Object> list = session.createCriteria(Object.class); Since…
-
1
votes0
answers89
viewsThe Operation could not be performed because OLE DB Provider "MSDASQL" for Linked server "XYZ" was Unable to Begin a Distributed transaction
I’m trying to accomplish a update in a database on another server through a LINKED SERVER configured on my local server. Already tested and is working perfectly when using darlings in the SGBD. In…
-
1
votes1
answer64
viewsError inserting data with Hibernate
I’m having an error inserting into my database: ERROR: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near 'de…
-
1
votes0
answers126
viewsSpring Security + CDI + Hibernatefilter
good afternoon! I am in a system with Primefaces, Hibernate, CDI and am implementing security with Spring-Security and control transactions with Hibernatefilter, declared on web.xml. I did all the…
-
1
votes0
answers23
viewsHibernate Connection
I’m trying to make an application using the Hibernate, but when will I create the file .cfg.xmI don’t recognize the driver of the mysql, even though it’s in my lib the connector of mysql. Someone…
-
1
votes1
answer29
viewsSpring + Hibernate
Good morning! I’m studying Spring MVC, Maven and Hibernate. In the structure of the project created with Maven, where I put the file applicationContext.xml ? Thank you.
-
1
votes1
answer180
viewsBug in Spring with Hibernate query code
I have a problem, I am studying spring mvc with Hibernate and I ended up entering a bug where it returns the following exception "java.lang.Nullpointerexception", follows the codes:…
-
1
votes1
answer314
viewsSave entity and all its daughter entities
I have problems with the updates of my entity Mdfe, before explaining what happens, I would like you to look at the image below, from it I can explain better. We can verify that The Mdfe has a…
-
1
votes1
answer82
viewsSave only if not null
How do I map with Hibernate @OneToOne and save only if the information has data in the related table? Example: public class ObservacaoPessoa { @Id @GeneratedValue(strategy = GenerationType.IDENTITY)…
-
1
votes1
answer196
viewsOGM + Mongodb Hibernate module error inside Wildfly 10
I am in need of a help to set up Wildfly 10 with Hibernate OGM and Mongodb... I have the following error: 11:13:17,164 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed…
-
1
votes0
answers93
viewsI cannot delete my object in datatable - JSF
I am unable to delete an object in my datatable. NOTE: I can already persisistir and change. My Bean package com.irmaosuspension.controleservico.controller; import java.io.Serializable; import…
-
1
votes0
answers120
viewsDAO Method Cannot Save Image
My bean class can already save the image in my specific directory,I know this because I did a test, but it only needs to be able to save the String that is the name of the file I do Fileupload in…
-
1
votes1
answer216
viewsJpa does not create column @lob
I’m mapping a field @lob to save image to a table, but jpa creates the table, but does not create the column. I created the column manually in MYSQL, but then the bytes do not persist either. My…
-
1
votes2
answers1825
viewsDoubts how to leave a unique attribute - JPA
I am creating an entity, and I have a CPF field and this field that is unique, how to map this CPF field? My entity. @Entity public class Client { @Id @GeneratedValue(strategy =…
-
1
votes0
answers68
viewsChange method to insert image - JSF
How do I change the method to insert the image? public Produto gravarImagem(Produto produto) { Session sessao = HibernateUtil.getSessionFactory().openSession(); Produto produtos = null; try { Query…
-
1
votes0
answers107
viewsDoubt about dependency injection in Customer Systems of Hibernate
I wonder if there is any way I can inject resources into an Hibernate Event Listener using vraptor 3.5. I wish I could simulate the behavior of a Rigger that we have in the database. And this…
-
1
votes2
answers187
viewsjavax.servlet.Servletexception: java.lang.Exceptionininitializererro
I’m trying to create my first project using JPA, using Jboss 5, Oracle, Hibernate and primefaces. After deploying the project I try to create and insert a new client into the bank through the web…
-
1
votes1
answer312
viewsShow sql generated by JPA/Hibernate
Is there any way to show SQL generated by JPA/Hibernate without enabling the property <property name="hibernate.show_sql" value="true"/>? The difficulty is that I need to monitor only one…
-
1
votes1
answer165
viewsDoubt about JPQL
I honestly have a certain difficulty with comics, and I need a JPQL that returns only one record. I have a Price entity and a Product entity. I need to bring the last registered price by the user. I…
-
1
votes0
answers108
viewsProblem with aggregation function, using Hibernate Createquery
In a Package, a fkEmbaling refers to the 'father', the larger package. EX: Let’s say that 10 A packs fit inside a B package. A packaging record A will have in its fkEmballing the packaging B in…
-
1
votes1
answer752
views@Size, using Hibernate Validator, accuses error in value that should pass validation
I have a Java SE application where I can’t use the @size annotation. This annotation is worked out by the org.hibernate.Validator.Size. There is a user field in the model where I do so: @Size(min =…
-
1
votes1
answer73
viewsTables not being generated - Hibernate
I have 2 tables of my software that are not being generated correctly. SQL is generated, but when checking in Mysql, not the encounters. If I change the tag to: <property…
-
1
votes0
answers49
viewsHow to prevent the Hibernate Connection pool to launch the connection limit exception?
I have a stateless DAO using JPA that uses the Hibernate Connection pool to apply your transactions with the database. Whenever the entityManager Hibernate is started, I have the following line on…
-
1
votes1
answer75
viewsDelete From Database without deleting related objects
I have a system in which I register Instructors and Students, each Instructor can have several Students under supervision and each Student can have only one Instructor or no Instructor. My problem…
-
1
votes3
answers80
viewsDoubt about instructions that can be implemented in Hibernate
Technical Course Test Question of Java Programming Language: What instructions can be used in Hibernate? a- JDBC b- JPA c-SQL d- JNDI…
-
1
votes0
answers496
viewsjavax.faces.el.Evaluationexception: java.lang.Nullpointerexception
You guys are my last salvation. I get this mistake javax.faces.el.EvaluationException: java.lang.NullPointerException when I try to register a client. My experience with development is low, I am…
-
1
votes1
answer74
viewsRecord method has no action and link of Dependent x Driver is not done
When developing a simple application where the dependent is linked to his responsible one who is a driver, when I click to create the link and record dependent nothing happens, only the following…
-
1
votes0
answers43
viewsNullpointexception using JSTL
Hello. Guys, I’m having a problem trying to pull up a list of users using a c:foreach. When requesting the list, a Nullpointexception is returned, which, although I understand the reason for the…
-
1
votes1
answer111
viewsHibernate Problem 4.3 with Glassfish 3.1
My application with Hibernate 4.3 wheel normally with Glassfish 4, installed together with the IDE NetBeans. However, the server where I need to deploy the application, has the Glassfish 3.1. On…
-
1
votes1
answer148
viewsSelectonemenu (Primefaces) field not saved in the seat
I’ve come to ask for your help again because I need to finish my CBT. I have a dialog which has several fields, one of them is a <p:selectOneMenu>. When I fill in all fields and go save, all…
-
1
votes1
answer99
viewsDistinc Criteria Hibernate java
I have the following context: class Entidade1 private Long id; private int commentId; private int userId; class Entidade2 private Long id; private String descricao; - I have the following criteria…
-
1
votes0
answers94
viewsError displaying a collection of a contact’s phones and emails
I want to display on a XHTML page (JSF+Primefaces) a list of contacts with phones and emails. I can display everything I want in a test class: package com.fercosmig.testes; import java.util.List;…
-
1
votes1
answer514
viewsThe find() method of my entityManager from DAO Generica is giving Nullpointer, how to correct?
The change of my DAO is like this: private EntityManager entityManager; public void alterar() throws Exception { System.out.println("T encontrada"); System.out.println("iniciando Alterar id: " +…