Questions tagged as 'hibernate'

1
answer

JPA return from the Many side of an entity @OneToMany using @OrderBy

I have the following Cliente entity that has Pedidos . The relationship between clients and requests is mapped with Cliente @OneToMany and Pedidos @ManyToOne . What I need is for the Customer Requests list to be sorted by...
asked by 15.08.2018 / 15:30
3
answers

Map java.time properties with Hibernate and / or JPA

Is there any way to map properties like java.time.LocalDate and / or java.time.Instant through JPA and / or Hibernate?     
asked by 05.07.2014 / 23:28
2
answers

Paste sql Hibernate

Good morning. I have the following problem, I need to get the sql executed by hibernate and save it to a string. But I have no idea how to do this, could anyone help?     
asked by 29.08.2016 / 17:45
1
answer

I can not ignore fields when trying to return them as Json causing "Infinite recursion"

I'm working with Hibernate , Spring and Jackson (to ignore the fields) and trying to return the User < strong> in a request json java returns error due to @OneToMany and @ManyToOne mapping with the Profile class. Does anyone know why?...
asked by 11.03.2016 / 06:57
2
answers

Problem changing the type of a column in the model using JPA annotation

I have a column in the database that is limited to receiving a varchar(255) , but I need to change that to a larger size. For this I have added these annotations in the field: @Column(nullable = true, columnDefinition = "TEXT") @Lengt...
asked by 22.04.2015 / 21:54
1
answer

Data Truncation with Hibernate

Good Night. I have a problem with persisting an object, hibernate throws an exception saying that the data is too long for the "street" column, of type String. Follow Pojos and DAO. Address @Embeddable public class Endereco implements...
asked by 07.12.2015 / 03:10
1
answer

Error inserting into the Hibernate database

How do I insert the ProductIngredient object into the database that is composed of an Ingredient object that already exists in the database, without duplicating the Ingredient object in the database. If I remove the cascade and put in the Ingred...
asked by 08.03.2014 / 22:20
1
answer

Hibernate + Inheritance

I'm trying for some time a solution to my problem. I have researched a lot but nothing explains me clearly what I need. So I created an example application and I'm making it available from this link: Appliance To run this application, si...
asked by 05.08.2014 / 22:25
1
answer

Error running function for the second time

Inside the controller I have this function: public void salvaEncaminhamento() { Integer qtdEncaminhamento = 0; if (manifestacao.getTbEncaminhamentoCollection() != null) { qtdEncaminhamento = manifestacao.getTbEncaminhamentoCol...
asked by 04.09.2017 / 19:14
1
answer

Detached exception in associative table

I'm finding the following problem when making a certain registration: Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: br.com.arena.model.Pessoa...
asked by 15.07.2016 / 17:55