Questions tagged as 'jpa'

0
answers

JPA (hibernate) automatically update entities [closed]

I have the following question: I realized that when I use JPA (Hibernate) + Spring in a JSF application (PrimeFaces) my entities are not updated immediately when registering, for example, I have a User when doing the same everything happens norm...
asked by 10.02.2015 / 20:41
1
answer

Get list of persistent JPA / Hibernate objects

Hello, how do I get the list of persisted objects before committing it to DB. Here's the example below: Pessoa p = new Pessoa("Joao", 21); Pessoa p2 = new Pessoa("Pedro", 17); Pessoa p3 = new Pessoa("Maria", 32); //Entendo que nesse momento o...
asked by 03.03.2015 / 13:02
2
answers

Hibernate ORDER BY ASC | DESC does not work by passing by parameter

Well, I have a problem with sorting a query, where I am passing the field name along with ASC or DESC as the query parameter, but hibernate is not finding himself, returning the query without the ordering. Would anyone have a solution to thi...
asked by 31.03.2016 / 22:43
1
answer

orphanRemoval JPA

How does orphanRemoval work? Why when I put it in a list does not work ex: @OneToMany(mappedBy = "simulationMedia", cascade = CascadeType.ALL, orphanRemoval = true) @JsonIgnore private List<SimulationChemicalMedia> simulat...
asked by 05.10.2015 / 22:19
4
answers

Hibernate - How to fetch all rows from a table with Hibernate?

I'm not able to fetch all rows from a table with Hibernate. Does anyone know the name of the method that does this?     
asked by 05.07.2018 / 18:53
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
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
2
answers

Integration between Spring MVC and JPA

I'm trying to integrate Spring with JPA but so far I have not had success in this configuration. One of the doubts is if I can configure the bank through spring-context.xml . Here is the error that I am trying to solve at the...
asked by 27.10.2016 / 19:22
2
answers

Call Stored Procedure with JPA 2.0

I need to call the following procedure below, so the company projects use JPA 2.0 and all the examples I encounter are for JPA 2.1 + . prc_performance_vendas_obter(vdataini => :vdataini, vdatafim => :vdatafi...
asked by 06.03.2017 / 21:27
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