Questions tagged as 'jpa'

1
answer

Perform a date search on a timestamp column using spring data

I am trying to perform a search only for the current date in a timestamp column, ie without informing the time, but only the date. Template: @DateTimeFormat(pattern = "dd/MM/yyyy hh:mm") @Temporal(TemporalType.TIMESTAMP) @Column(name = "d...
asked by 20.09.2017 / 15:19
1
answer

Problems in JPA, @OneToOne and mappedBy

I have three classes, Person, Client and Address, being Client of Person's Child and Address by adding Person. Follow Person: @Entity public abstract class Pessoa implements Serializable { private static final long serialVersionUID = 1L; @...
asked by 05.07.2017 / 19:53
1
answer

Problem in persistence of data using JPA

I have a class that has two attributes, start time and end time, both of type Date. @Temporal(TemporalType.TIME) private Date horarioInicio; @Temporal(TemporalType.TIME) private Date horarioFinal; In the view layer the Spring Data Binding f...
asked by 10.06.2017 / 20:30
1
answer

What is optimistic locking field of JPA

What is and what is JPA's Optimistic Locking Field? I noticed that this option exists for Eclipse Link and for Hibernate and this function is enabled when annotating a version attribute within an entity class, but I do not understand what its pu...
asked by 21.03.2017 / 14:44
1
answer

How to limit a 1 relationship to many JPA?

I'm using JPA with Spring Framework in a project, I'd like to limit a 1:n relationship, I want to 1:5 , how do I do this? > The relationship is this: @ManyToOne private Task task;     
asked by 26.10.2016 / 13:17
1
answer

Mapping classes HIBERNATE

Well, I have a question about an exercise that was passed in the facul recently. I have to map classes with JPA, Hibernate and I'm having a bit of trouble in mapping the relationships of those classes. The problem is this, the exercise is a...
asked by 06.09.2016 / 16:54
1
answer

Compound key problems in JPA

Hello, I'm kind of new to JPA and I'm having trouble with a compound PK. The class Aluno follows: @Entity @Table(name = "Aluno") public class Aluno { @Id private String ra; @Column(length = 50, nullable = false) pri...
asked by 19.08.2016 / 06:07
1
answer

@OneToMany without Primary Key

Is there a possibility to make a @OneToMany relation without Primary Key in the child table? Follow my two entities. Entity Noticia : @Entity @Table(name = "NOTICIA") @NamedQueries({ @NamedQuery(name = "Noticia.findAll...
asked by 25.08.2016 / 14:04
2
answers

Annotation problem for mapping

I'm having errors due to my mapping to my program in java, I'm still starting to mess with annotation (please forgive possible stupid errors xD). The error should be in @ ManyToOne / OneToMany ... I have two tables, ACCOUNT and PLAYER. After...
asked by 18.11.2016 / 16:54
1
answer

Second Level Cache - JPA and EclipseLink

I would like to completely disable the JPA / EclipseLink cache, but I can not. I can disable the first level cache using: query.setHint("javax.persistence.cache.storeMode", CacheStoreMode.REFRESH) But the second level cache is not disabl...
asked by 11.09.2015 / 22:07