Questions tagged as 'hibernate'

1
answer

Problem persisting object with @ManyToOne - JPA / Hibernate

I have the following problem: I can save / persist the two objects below, but JPA is not binding the ID of the DeclaracaoImportacao in the class / entity ID column. Follow the code @Entity @Table (name = "declaracaoimportacao") publi...
asked by 22.09.2016 / 21:12
1
answer

How to adapt Hibernate to the DAO standard?

I'm starting to study Hibernate and wanted to "start right". The doubt is as follows: For the entire transaction I need to use the following code: Session session = HibernateUtil.getSessionFactory().openSession(); session.beginTr...
asked by 18.02.2016 / 14:19
2
answers

Problems removing element @ManyToMany with @JoinTable

I'm having problems deleting a @ManyToMany relationship in JPA. In short, I have 3 tables: USER, PERMISSION, and USER_PERMISSION that is the relationship of the previous ones, the relationship is N to N. The problem is that I'm not sure how to r...
asked by 10.01.2016 / 04:40
1
answer

Entities marked FETCH LAZY are returning "null" even after a call to the GET method

Hello, good morning, friends, Why are my entities marked as fetch lazy returning "null" even when they are invoked via a get? What I learned in several courses is that when I make the first call to a get method, hibernate would load the da...
asked by 19.11.2018 / 12:22
1
answer

Product displayed is the smallest within the group (Criteria)

I have a function in the system that I'm developing that returns a batch list where the batch quantity is greater than zero, searching for the product name (foreign key). Until that point I have. When doing the search it returns me all lots of t...
asked by 18.03.2016 / 00:35
1
answer

Incorrect information when loading bigdecimal entity

I have a table, that one of its columns is a numeric (25,10) that will be shown rates. But there are records that will be reset (0.0000000000) In my entity you have ownership of this fee, such as a BigDecimal . But when hibernate populat...
asked by 04.08.2015 / 22:28
1
answer

em.createNativeQuery executes first than em.persist and now?

I'm developing an application with Hibernate + Spring mv. spring takes care of EntityManager dependency for my DAO, however I have the following problem. I persist an object called User After I run createNativeQuery with "insert into table...
asked by 08.04.2015 / 06:28
2
answers

Problem with FileUpload

I had the opportunity to find an application ready on the internet as shown below: link But I'm new to the Java programmer, I tried to adapt the application my way, but I was not successful. Application has to add the name, value and...
asked by 27.05.2015 / 14:06
1
answer

try / catch not "catching" Exception

I'm using JPA and was trying to create an EntityManager, and was testing some expcetions treatments in a class of mine. However, I'm having a problem, that the exception is not being caught by the catch. public static boolean openConnection(...
asked by 03.08.2014 / 07:44
1
answer

I can not generate the table through Hibernate

I'm trying to create tables automatically by hibernate, but I'm not succeeding. The hibernate libraries are correct. the mysql connector is referenced as well as the hibernate libraries. I believe the problem is in the GeraTabela class. I'...
asked by 12.08.2014 / 01:08