Questions tagged as 'hibernate'

1
answer

How / When to Close Hibernate Session?

I have an error after closing Hibernate Session public String listarTodosClientes() { session.getTransaction().begin(); List<Cliente> lista = session.createCriteria(Cliente.class).list(); session.close(); return lista.toS...
asked by 13.11.2014 / 13:36
1
answer

Using Hibernate to generate tables with h2

I'm developing an application in which I decided to use h2 as the embedded database. This is the first time I'm using this type of database and I'm having trouble generating the tables through hibernate. My hibernate.cfg.xml : <hibernat...
asked by 03.05.2014 / 23:02
1
answer

In hibernate, whenever I change the Entity configuration, do I have to drop the table in the database?

Example: I have the Person class below: @Entity public class Pessoa { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long idPessoa; private String nome; //getters e setters } Hibernate, by default, pe...
asked by 08.08.2015 / 15:41
1
answer

Obtaining factory null in spring SessionFactory with Resource configured

The class name containing SessionFactory is DataProvider and has the following implementation: @Resource(name="sessionFactory") protected SessionFactory factory; protected Class<E> entity; protected String tableName; publ...
asked by 18.02.2014 / 18:39
1
answer

Data modeling via JPA and Hibernate

I am doing a project with JPA for a quotation system and I have doubts on how to build the relationship between classes, and would like (if possible) some opinions. My project is a quotation system, where the company will create a quote and s...
asked by 08.08.2015 / 22:16
1
answer

JSF / Hibernate How do I write null to a bank field?

I have an application using Primefaces / JPA-Hibernate / TomCat8, and need that when an on-screen field is empty, it writes null to the database (Postgres). I need this because I have some fields in the database that have UniqueKey, and e...
asked by 07.11.2015 / 17:31
1
answer

Error java.lang.ClassNotFoundException: "Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.type.TypeReference

I'm developing a Java, FX, Hibernate application and using log4j2 for my logs. When I run the application through the IDE (Eclipse) everything works normally, but when creating the application .jar, the following errors appear (just when startin...
asked by 26.01.2016 / 14:43
2
answers

Hibernate correctly configured does not insert into the database

My code does not enter into the Mysql database. It identifies all the database, the tables and the fields, but the insertion is not done. UserID.java package br.com.sistec.dao; import org.hibernate.Session; import org.hibernate.Tran...
asked by 27.06.2015 / 23:13
0
answers

How to do concurrency control in Hibernate for INSERT in the database

I have a competition control problem in inserting data into my web application. Context: I have 3 tables (ex: X, Y and Z) that register hospitalizations of patients (already registered). A patient can not have more than one ACTIVE hospitaliza...
asked by 07.06.2018 / 20:09
2
answers

GET request is not answered correctly by the backend

The project is an Angular 6 front end, which connects to a Java back-end for communication with a SQL Server BD. The server that receives the file .war , containing the back as the front, is Tomcat 8.5.32. The structure for logging i...
asked by 17.08.2018 / 18:19