Questions tagged as 'hibernate'

0
answers

Hibernate JPA - delete children within list

public class A implements Serializable { @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) @JoinColumn(name = "A_ID") private List<B> bList; } public class B implements Serializable { @JoinCo...
asked by 29.05.2018 / 15:43
0
answers

Get variable value optionalObject []

I am making a select by taking the result as below: Optional<Object[]> oLista = query2.getResultList().stream().findFirst(); oLista2.isPresent { Integer ident = (Integer) oLista.get()[0]; } You need to get the value but yo...
asked by 29.05.2018 / 15:00
1
answer

OneToMany or ManyToOne?

Good evening, I have some basic beginner questions I need to create a timeline that has the following: What events occurred in a given date range, who was born and who died in this range? I have the Person, Event, and Timeline classes. My Tim...
asked by 29.05.2018 / 06:31
0
answers

Spring Tools Suit - Extension for creating meta model

Hello, I was reading an article where author creates a meta-class class to work with strongly typed queries. I would like to know if there is any extension or plugin for the Spring-Tools-Suite (STS) IDE that automatically creates metamodel cl...
asked by 27.05.2018 / 12:45
2
answers

How to use @MappedSuperclass @Id with @Sequence Individual - hibernate oracle

I need to solve a question of using inheritance and sequences with hibernate and Oracle. I'm using Maven with: hibernate-core 5.1.5.Final hibernate-entitymanager 5.1.5.Final hibernate-validator 5.1.3.Final eclipselink 2.6.5 ojdbc6 11.2.0.4 ja...
asked by 29.05.2018 / 19:56
1
answer

EntityManagerFactory closed session

About this topic: Change in database and update of entity Resolved, but now gives another EntityManagerFactory is closed error. I created this class: package br.com.netsoft.dao; import javax.persistence.EntityManager; import javax.pe...
asked by 17.05.2018 / 05:15
0
answers

org.hibernate.exception.JDBCConnectionException: Could not open connection

I'm having trouble losing connection to the MySQL database, which occurs after a few minutes of use. Please, could anyone help me? I have no idea what it can be. Here are my codes: hibernate.cfg.xml <property name="hibernate.conn...
asked by 18.05.2018 / 22:17
0
answers

Project in JSF 2.3 with delay in the initial connection

I'm making a system using Java1.8, JSF 2.3, hibernate 5.4.x and Tomcat 9, with standard MVC and entitymanager. The problem is that to save the first object on a form, it takes about 3 to 5 seconds. Then everything is normal. I think it's the...
asked by 12.05.2018 / 00:03
0
answers

Which Hibernate annotation to use for clob

I have an attribute that takes a string and must be persisted in a clob in the oracle sql. I looked in the documentation that should be used annotation @Lob:    @Lob indicates that the property should be persisted in a Blob or a   Clob, depen...
asked by 07.05.2018 / 05:39
0
answers

Hibernate does not connect to MySql database

Hello, I needed to take on the development of a servlet that was in someone else's hands. The same is contained in a Tomcat server and must connect to a MySql database to store data of users registered in their forms. The problem is that I...
asked by 01.05.2018 / 14:50