6
6
import java .sql .Date ;
7
7
import java .sql .Time ;
8
8
import java .sql .Timestamp ;
9
+ import java .time .LocalDate ;
10
+ import java .time .LocalDateTime ;
9
11
10
12
import org .apache .cayenne .BaseDataObject ;
11
13
import org .apache .cayenne .exp .property .DateProperty ;
@@ -24,10 +26,14 @@ public abstract class _E16 extends BaseDataObject {
24
26
public static final String ID_PK_COLUMN = "id" ;
25
27
26
28
public static final DateProperty <Date > C_DATE = PropertyFactory .createDate ("cDate" , Date .class );
29
+ public static final DateProperty <LocalDate > C_LOCAL_DATE = PropertyFactory .createDate ("cLocalDate" , LocalDate .class );
30
+ public static final DateProperty <LocalDateTime > C_LOCAL_DATE_TIME = PropertyFactory .createDate ("cLocalDateTime" , LocalDateTime .class );
27
31
public static final DateProperty <Time > C_TIME = PropertyFactory .createDate ("cTime" , Time .class );
28
32
public static final DateProperty <Timestamp > C_TIMESTAMP = PropertyFactory .createDate ("cTimestamp" , Timestamp .class );
29
33
30
34
protected Date cDate ;
35
+ protected LocalDate cLocalDate ;
36
+ protected LocalDateTime cLocalDateTime ;
31
37
protected Time cTime ;
32
38
protected Timestamp cTimestamp ;
33
39
@@ -42,6 +48,26 @@ public Date getCDate() {
42
48
return this .cDate ;
43
49
}
44
50
51
+ public void setCLocalDate (LocalDate cLocalDate ) {
52
+ beforePropertyWrite ("cLocalDate" , this .cLocalDate , cLocalDate );
53
+ this .cLocalDate = cLocalDate ;
54
+ }
55
+
56
+ public LocalDate getCLocalDate () {
57
+ beforePropertyRead ("cLocalDate" );
58
+ return this .cLocalDate ;
59
+ }
60
+
61
+ public void setCLocalDateTime (LocalDateTime cLocalDateTime ) {
62
+ beforePropertyWrite ("cLocalDateTime" , this .cLocalDateTime , cLocalDateTime );
63
+ this .cLocalDateTime = cLocalDateTime ;
64
+ }
65
+
66
+ public LocalDateTime getCLocalDateTime () {
67
+ beforePropertyRead ("cLocalDateTime" );
68
+ return this .cLocalDateTime ;
69
+ }
70
+
45
71
public void setCTime (Time cTime ) {
46
72
beforePropertyWrite ("cTime" , this .cTime , cTime );
47
73
this .cTime = cTime ;
@@ -71,6 +97,10 @@ public Object readPropertyDirectly(String propName) {
71
97
switch (propName ) {
72
98
case "cDate" :
73
99
return this .cDate ;
100
+ case "cLocalDate" :
101
+ return this .cLocalDate ;
102
+ case "cLocalDateTime" :
103
+ return this .cLocalDateTime ;
74
104
case "cTime" :
75
105
return this .cTime ;
76
106
case "cTimestamp" :
@@ -90,6 +120,12 @@ public void writePropertyDirectly(String propName, Object val) {
90
120
case "cDate" :
91
121
this .cDate = (Date )val ;
92
122
break ;
123
+ case "cLocalDate" :
124
+ this .cLocalDate = (LocalDate )val ;
125
+ break ;
126
+ case "cLocalDateTime" :
127
+ this .cLocalDateTime = (LocalDateTime )val ;
128
+ break ;
93
129
case "cTime" :
94
130
this .cTime = (Time )val ;
95
131
break ;
@@ -113,6 +149,8 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE
113
149
protected void writeState (ObjectOutputStream out ) throws IOException {
114
150
super .writeState (out );
115
151
out .writeObject (this .cDate );
152
+ out .writeObject (this .cLocalDate );
153
+ out .writeObject (this .cLocalDateTime );
116
154
out .writeObject (this .cTime );
117
155
out .writeObject (this .cTimestamp );
118
156
}
@@ -121,6 +159,8 @@ protected void writeState(ObjectOutputStream out) throws IOException {
121
159
protected void readState (ObjectInputStream in ) throws IOException , ClassNotFoundException {
122
160
super .readState (in );
123
161
this .cDate = (Date )in .readObject ();
162
+ this .cLocalDate = (LocalDate )in .readObject ();
163
+ this .cLocalDateTime = (LocalDateTime )in .readObject ();
124
164
this .cTime = (Time )in .readObject ();
125
165
this .cTimestamp = (Timestamp )in .readObject ();
126
166
}
0 commit comments