java sql date jpa

Solutions on MaxInterview for java sql date jpa by the best coders in the world

showing results for - "java sql date jpa"
Silvia
16 Apr 2017
1@Entity
2public class MyEntity {
3 
4    @Id
5    @GeneratedValue(strategy = GenerationType.AUTO)
6    private Long id;
7     
8    @Temporal(TemporalType.TIMESTAMP)
9    private Date utilDate;
10     
11    @Temporal(TemporalType.DATE)
12    private Calendar utilCalendar;
13     
14    ...
15     
16    public Date getUtilDate() {
17        return utilDate;
18    }
19 
20    public void setUtilDate(Date utilDate) {
21        this.utilDate = utilDate;
22    }
23 
24    public Calendar getUtilCalendar() {
25        return utilCalendar;
26    }
27 
28    public void setUtilCalendar(Calendar utilCalendar) {
29        this.utilCalendar = utilCalendar;
30    }
31}
32