Questions tagged as 'hibernate'

2
answers

Doubt how to leave a single 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 = GenerationType.IDENTITY) private Long codigo; private Stri...
asked by 20.03.2017 / 18:25
2
answers

How to Order List (Hibernate)

How can I sort a List with java and Hibernate? I have an abstract class with this method public List<T> listarContas(String where) { String consulta = "FROM " + entityClass.getSimpleName()+ " where "+ where; Query query = getE...
asked by 02.05.2017 / 16:28
1
answer

JPA Error with MySQL 8

Hello, After updating my database, my application has been displaying exceptions of type java.sql.SQLSyntaxErrorException . The class below is the one it complains about, saying it does not exist when hibernate tries to create it. @Enti...
asked by 31.08.2018 / 15:52
1
answer

For does not scroll through the entire list

I have a problem scrolling through a list. My for looks like this: for (int i = 0; i < listaCaixaAbertos().size(); i++) { listaCaixaAbertos().get(i).setFechado(Boolean.TRUE); salvar(listaCaixaAbert...
asked by 01.02.2018 / 18:48
2
answers

Connection problems between Hibernate and MySQL database [closed]

Hello, I'm starting Hibernate studies and I'm not making a MySQL database connection. Here's my code below: import java.util.Calendar; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; impor...
asked by 24.01.2017 / 15:29
2
answers

Many to One Hibernate Java

I have 2 entities:    Contracts, which has only id, number       Additive, which has id, number, contract The additive contract is a foreign key, in the database it is working right works like this: 1 contract may have several additiv...
asked by 10.11.2016 / 11:48
2
answers

How to search the Session in Hibernate 5.2.3.Final

Hello! I am changing my Hibernate from version 4.3.8.Final to 5.2.3.Final. Now I am not able to fetch the Hibernate Session as it did before, like this: (Session) manager.unwrap(Session.class); Give Cast Error :java.lang.Clas...
asked by 13.10.2016 / 22:06
2
answers

How to stop database query using time out in hibernate?

I'm developing an application that queries a gigantic database, so I'd like to maintain its integrity by allowing Hibernate to query up to 30 seconds. In the face of this problem, what would be the best way to solve it?     
asked by 19.02.2016 / 17:58
2
answers

Error in the authentication of a web system

I'm learning next to a tutorial to develop a petshop system and am getting the following Hibernate error:    Hibernate: select client0_.idClient idClient2_2_, client0_.email as email3_2_, client0_.name the_name_2_, client0_.password the passw...
asked by 04.01.2016 / 20:47
1
answer

Update column and table definitions with Hibernate

Good afternoon. I would like to know and confirm if you have any way to update table and column definitions in each schema using Hibernate. For now, what I've seen so far is that Hibernate only creates tables and columns, but does not dele...
asked by 06.03.2015 / 18:10