Questions tagged as 'jpa'

2
answers

OneToOne Mapping JPA 2.2 Unidirectional

Hello, everyone. I'm using JPA + hibernate 4 on top of the database structure (MySQL 5.6) below. I'm in doubt about the @OneToOne relationship. What's happening: Entity BodyPart has a @OneToOne relation with Body...
asked by 04.11.2016 / 14:52
1
answer

How to persist abstract class with JPA

I know JPA and I have other tables already implemented and working. I would like to know how to persist the classes below, since one is an abstract class and the other is "extending" it. Should I put annotations and properties as if...
asked by 08.04.2015 / 21:09
2
answers

Remove association in relation to Many to Many

I have a one-way @manytomany fault relationship and I need to remove this association according to some criteria but I did not want to have to navigate all objects in the collection to remove one-by-one. I thought of JQPL " delete f...
asked by 27.11.2014 / 13:58
1
answer

N-N relationship with additional fields (problems persisting data)

I have an N-N relationship that works as follows: Destination.java (N) - (N) CustomerService.java Within this relationship there is an entity that holds the Id's of relationships, which has some more values. The name of this is ServiceI...
asked by 17.12.2014 / 21:47
0
answers

ERROR: null value in column "id_municipio_id_municipio" violates the non-null constraint [closed]

This error is occurring when I try to persist the screen data to the bank. I checked, by debugging the screen, that the data is being fetched. When the method exits line 33 of the image it goes straight to line 45. Theserverloglookslikethis:...
asked by 28.09.2017 / 22:38
2
answers

Cut bi-directional relationship looping

I'm having a Spring project, using JPA and Liquibase, I have a two-way relationship between two entities, I wonder if anyone has a solution to the infinite referral problem between the two? For example, I have a Question that has many answers, a...
asked by 10.06.2016 / 13:45
2
answers

JPA, Oracle and Handling Exceptions

I'm using vraptor 4, JPA and Oracle. But when an exception occurs during persistence, the error code that Oracle generates is not coming along with Exeption. This is the Repository @Repository public class AuthUserRepository { publi...
asked by 19.05.2014 / 22:14
2
answers

Customize error message

I forced an error on my system that contains the following message:    javax.persistence.PersistenceException:   org.hibernate.exception.ConstraintViolationException: could not   execute statement It is a constraint violation. How can I c...
asked by 09.06.2016 / 22:20
1
answer

How to structure the hibernate Entity relationship annotations?

I would like to understand the difference between hibernate annotations with JPA: @OneToOne, @OneToMany, @ManyToMany and @ManyToOne of hibernate, how does it work?     
asked by 22.07.2015 / 18:59
1
answer

Unwanted Result - SQL Query

Hello. I'm a problem and I can not see a way to solve it. My data from the move table: Myquery:selectavg(m.valor)fromMovimentacaomwherem.tipo='SAIDA'groupbym.data;Myresult: I can not group the average by date (day). Even if I use d...
asked by 04.09.2018 / 02:30