Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/Java/DATT/src/org/litesoft/datt/server/pos/StoryUpdateGO.java

Diff revisions: vs.
  @@ -9,25 +9,21 @@
9 9
10 10 public abstract class StoryUpdateGO
11 11 extends org.litesoft.orsup.nonpublic.PersistentObjectImpl<StoryUpdate>
12 - implements HasAttributes
13 - {
12 + implements HasAttributes {
14 13 private static final ConstructionControl CONSTRUCTION_CONTROL = new ConstructionControl();
15 14
16 - public static SimpleFromIdentifier from()
17 - {
15 + public static SimpleFromIdentifier from() {
18 16 return StoryUpdateMetaData.INSTANCE;
19 17 }
20 18
21 - protected StoryUpdateGO( Transaction pTransaction )
22 - {
19 + protected StoryUpdateGO( Transaction pTransaction ) {
23 20 super( StoryUpdateMetaData.INSTANCE, pTransaction );
24 21 mID = getNextSequenceNumber( getClass() );
25 22 registerWithTransaction();
26 23 setDefaults();
27 24 }
28 25
29 - protected StoryUpdateGO( ConstructionControl pConstructionControl )
30 - {
26 + protected StoryUpdateGO( ConstructionControl pConstructionControl ) {
31 27 super( StoryUpdateMetaData.INSTANCE, CONSTRUCTION_CONTROL, pConstructionControl );
32 28 }
33 29
  @@ -35,22 +31,18 @@
35 31
36 32 protected final RecordVersionHelper mRecordVersion = new RecordVersionHelper();
37 33
38 - public Long getRecordVersion()
39 - {
34 + public Long getRecordVersion() {
40 35 return mRecordVersion.getRecordVersion();
41 36 }
42 37
43 38 private static class AttributeAccessor_RecordVersion
44 - extends AttributeAccessorSCD_RecordVersion<StoryUpdate>
45 - {
46 - public AttributeAccessor_RecordVersion()
47 - {
39 + extends AttributeAccessorSCD_RecordVersion<StoryUpdate> {
40 + public AttributeAccessor_RecordVersion() {
48 41 super( "RecordVersion", "RecordVersion" );
49 42 }
50 43
51 44 @Override
52 - protected RecordVersionHelper getRecordVersionHelper( StoryUpdate pPO )
53 - {
45 + protected RecordVersionHelper getRecordVersionHelper( StoryUpdate pPO ) {
54 46 return pPO.mRecordVersion;
55 47 }
56 48 }
  @@ -59,41 +51,34 @@
59 51
60 52 final org.litesoft.orsup.lazyeval.LazyEvalSimpleTimestamp mCreated = new org.litesoft.orsup.lazyeval.LazyEvalSimpleTimestamp();
61 53
62 - public org.litesoft.core.simpletypes.temporal.SimpleTimestamp getCreated()
63 - {
54 + public org.litesoft.core.simpletypes.temporal.SimpleTimestamp getCreated() {
64 55 return mCreated.getSimpleTimestamp();
65 56 }
66 57
67 - protected void LLsetCreated( org.litesoft.core.simpletypes.temporal.SimpleTimestamp pCreated )
68 - {
58 + protected void LLsetCreated( org.litesoft.core.simpletypes.temporal.SimpleTimestamp pCreated ) {
69 59 verifyMutability( CD_Created, mCreated.getSimpleTimestamp(), pCreated );
70 60 mCreated.setSimpleTimestamp( pCreated );
71 61 }
72 62
73 63 private static class AttributeAccessor_Created
74 64 extends AttributeAccessorSCDsimplePersistedSysSetOnly<StoryUpdate>
75 - implements NonImportableFeature
76 - {
77 - public AttributeAccessor_Created()
78 - {
65 + implements NonImportableFeature {
66 + public AttributeAccessor_Created() {
79 67 super( "Created", "Created", true, _SimpleTimestamp.RO() );
80 68 }
81 69
82 70 @Override
83 - public Object getValueOnPO( StoryUpdate pPO )
84 - {
71 + public Object getValueOnPO( StoryUpdate pPO ) {
85 72 return pPO.getCreated();
86 73 }
87 74
88 75 @Override
89 - public Object db_getValueOnPO( StoryUpdate pPO )
90 - {
76 + public Object db_getValueOnPO( StoryUpdate pPO ) {
91 77 return pPO.mCreated.get_java_sql_Timestamp();
92 78 }
93 79
94 80 @Override
95 - public void db_setValueOnPO( StoryUpdate pPO, Object pValue )
96 - {
81 + public void db_setValueOnPO( StoryUpdate pPO, Object pValue ) {
97 82 pPO.mCreated.set_java_sql_Timestamp( to_Timestamp( pValue ) );
98 83 }
99 84 }
  @@ -102,89 +87,74 @@
102 87
103 88 private Long mID;
104 89
105 - public Long getID()
106 - {
90 + public Long getID() {
107 91 return mID;
108 92 }
109 93
110 - protected void LLsetID( Long pID )
111 - {
94 + protected void LLsetID( Long pID ) {
112 95 verifyMutability( CD_ID, mID, pID );
113 96 mID = pID;
114 97 }
115 98
116 99 private static class AttributeAccessor_ID
117 100 extends AttributeAccessorSCDsimplePersistedSysSetOnly<StoryUpdate>
118 - implements NonImportableFeature
119 - {
120 - public AttributeAccessor_ID()
121 - {
101 + implements NonImportableFeature {
102 + public AttributeAccessor_ID() {
122 103 super( "ID", "ID", false, _Long.AddOnly() );
123 104 }
124 105
125 106 @Override
126 - public Object getValueOnPO( StoryUpdate pPO )
127 - {
107 + public Object getValueOnPO( StoryUpdate pPO ) {
128 108 return pPO.getID();
129 109 }
130 110
131 111 @Override
132 - public void db_setValueOnPO( StoryUpdate pPO, Object pValue )
133 - {
112 + public void db_setValueOnPO( StoryUpdate pPO, Object pValue ) {
134 113 pPO.LLsetID( to_Long( pValue ) );
135 114 }
136 115 }
137 116
138 - public static final AttributeAccessorSCDtoOneRegular<StoryUpdate,User> CD_ByWhom = new AttributeAccessor_ByWhom();
117 + public static final AttributeAccessorSCDtoOneRegular<StoryUpdate, User> CD_ByWhom = new AttributeAccessor_ByWhom();
139 118
140 - protected org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate,User> mByWhom = //
141 - new org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate,User>( (StoryUpdate) this, CD_ByWhom );
119 + protected org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate, User> mByWhom = //
120 + new org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate, User>( (StoryUpdate) this, CD_ByWhom );
142 121
143 - public User getByWhom()
144 - {
122 + public User getByWhom() {
145 123 return processLazyLoadAccess( mByWhom );
146 124 }
147 125
148 - public void setByWhom( User pByWhom )
149 - {
126 + public void setByWhom( User pByWhom ) {
150 127 processLazyLoadMutation( mByWhom, pByWhom );
151 128 }
152 129
153 130 private static class AttributeAccessor_ByWhom
154 - extends AttributeAccessorSCDtoOneRegular<StoryUpdate,User>
155 - {
156 - public AttributeAccessor_ByWhom()
157 - {
131 + extends AttributeAccessorSCDtoOneRegular<StoryUpdate, User> {
132 + public AttributeAccessor_ByWhom() {
158 133 super( "ByWhom", "ByWhom_id", User.class, "ID", "StoryUpdates", false, true, Mutability.RW );
159 134 }
160 135
161 136 @Override
162 - public org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate,User> getValueHolder( StoryUpdate pPO )
163 - {
137 + public org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate, User> getValueHolder( StoryUpdate pPO ) {
164 138 return pPO.mByWhom;
165 139 }
166 140
167 141 @Override
168 - public Object getValueOnPO( StoryUpdate pPO )
169 - {
142 + public Object getValueOnPO( StoryUpdate pPO ) {
170 143 return pPO.getByWhom();
171 144 }
172 145
173 146 @Override
174 - public void setValueOnPO( StoryUpdate pPO, Object pValue )
175 - {
147 + public void setValueOnPO( StoryUpdate pPO, Object pValue ) {
176 148 pPO.setByWhom( to_PO( pPO, User.class, pValue ) );
177 149 }
178 150
179 151 @Override
180 - public Object db_getValueOnPO( StoryUpdate pPO )
181 - {
152 + public Object db_getValueOnPO( StoryUpdate pPO ) {
182 153 return pPO.mByWhom.db_getValue();
183 154 }
184 155
185 156 @Override
186 - public void db_setValueOnPO( StoryUpdate pPO, Object pValue )
187 - {
157 + public void db_setValueOnPO( StoryUpdate pPO, Object pValue ) {
188 158 pPO.mByWhom.db_setValue( to_Long( pValue ) );
189 159 }
190 160 }
  @@ -196,165 +166,137 @@
196 166 /**
197 167 * An optional message to be added by the developer for an event. E.g. "Tasks merged from story XXX"
198 168 */
199 - public String getMessage()
200 - {
169 + public String getMessage() {
201 170 return mMessage;
202 171 }
203 172
204 - public void setMessage( String pMessage )
205 - {
173 + public void setMessage( String pMessage ) {
206 174 verifyMutability( CD_Message, mMessage, pMessage );
207 175 mMessage = pMessage;
208 176 }
209 177
210 178 private static class AttributeAccessor_Message
211 - extends AttributeAccessorSCDsimplePersistedRegular<StoryUpdate>
212 - {
213 - public AttributeAccessor_Message()
214 - {
179 + extends AttributeAccessorSCDsimplePersistedRegular<StoryUpdate> {
180 + public AttributeAccessor_Message() {
215 181 super( "Message", "Message", false, _String.with( MaxLength.of( 60 ), //
216 182 DisplayLength.of( 20 ) ) );
217 183 }
218 184
219 185 @Override
220 - public Object getValueOnPO( StoryUpdate pPO )
221 - {
186 + public Object getValueOnPO( StoryUpdate pPO ) {
222 187 return pPO.getMessage();
223 188 }
224 189
225 190 @Override
226 - public void setValueOnPO( StoryUpdate pPO, Object pValue )
227 - {
191 + public void setValueOnPO( StoryUpdate pPO, Object pValue ) {
228 192 pPO.setMessage( to_String( pValue ) );
229 193 }
230 194 }
231 195
232 - public static final AttributeAccessorSCDtoOneRegular<StoryUpdate,Story> CD_Story = new AttributeAccessor_Story();
196 + public static final AttributeAccessorSCDtoOneRegular<StoryUpdate, Story> CD_Story = new AttributeAccessor_Story();
233 197
234 - protected org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate,Story> mStory = //
235 - new org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate,Story>( (StoryUpdate) this, CD_Story );
198 + protected org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate, Story> mStory = //
199 + new org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate, Story>( (StoryUpdate) this, CD_Story );
236 200
237 - public Story getStory()
238 - {
201 + public Story getStory() {
239 202 return processLazyLoadAccess( mStory );
240 203 }
241 204
242 - public void setStory( Story pStory )
243 - {
205 + public void setStory( Story pStory ) {
244 206 processLazyLoadMutation( mStory, pStory );
245 207 }
246 208
247 209 private static class AttributeAccessor_Story
248 - extends AttributeAccessorSCDtoOneRegular<StoryUpdate,Story>
249 - {
250 - public AttributeAccessor_Story()
251 - {
210 + extends AttributeAccessorSCDtoOneRegular<StoryUpdate, Story> {
211 + public AttributeAccessor_Story() {
252 212 super( "Story", "Story_id", Story.class, "ID", "Updates", false, true, Mutability.RW );
253 213 }
254 214
255 215 @Override
256 - public org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate,Story> getValueHolder( StoryUpdate pPO )
257 - {
216 + public org.litesoft.orsup.lazyload.LazyLoadToOneRegular<StoryUpdate, Story> getValueHolder( StoryUpdate pPO ) {
258 217 return pPO.mStory;
259 218 }
260 219
261 220 @Override
262 - public Object getValueOnPO( StoryUpdate pPO )
263 - {
221 + public Object getValueOnPO( StoryUpdate pPO ) {
264 222 return pPO.getStory();
265 223 }
266 224
267 225 @Override
268 - public void setValueOnPO( StoryUpdate pPO, Object pValue )
269 - {
226 + public void setValueOnPO( StoryUpdate pPO, Object pValue ) {
270 227 pPO.setStory( to_PO( pPO, Story.class, pValue ) );
271 228 }
272 229
273 230 @Override
274 - public Object db_getValueOnPO( StoryUpdate pPO )
275 - {
231 + public Object db_getValueOnPO( StoryUpdate pPO ) {
276 232 return pPO.mStory.db_getValue();
277 233 }
278 234
279 235 @Override
280 - public void db_setValueOnPO( StoryUpdate pPO, Object pValue )
281 - {
236 + public void db_setValueOnPO( StoryUpdate pPO, Object pValue ) {
282 237 pPO.mStory.db_setValue( to_Long( pValue ) );
283 238 }
284 239 }
285 240
286 - public static final AttributeAccessorSCDtoManyRegular<StoryUpdate,StoryChange> CD_Changes = new AttributeAccessor_Changes();
241 + public static final AttributeAccessorSCDtoManyRegular<StoryUpdate, StoryChange> CD_Changes = new AttributeAccessor_Changes();
287 242
288 - protected org.litesoft.orsup.lazyload.LazyLoadToManyRegular<StoryUpdate,StoryChange> mChanges = //
289 - new org.litesoft.orsup.lazyload.LazyLoadToManyRegular<StoryUpdate,StoryChange>( (StoryUpdate) this, CD_Changes );
243 + protected org.litesoft.orsup.lazyload.LazyLoadToManyRegular<StoryUpdate, StoryChange> mChanges = //
244 + new org.litesoft.orsup.lazyload.LazyLoadToManyRegular<StoryUpdate, StoryChange>( (StoryUpdate) this, CD_Changes );
290 245
291 - public java.util.List<StoryChange> getChanges()
292 - {
246 + public java.util.List<StoryChange> getChanges() {
293 247 return processLazyLoadAccess( mChanges );
294 248 }
295 249
296 - public void setChanges( java.util.List<StoryChange> pChanges )
297 - {
250 + public void setChanges( java.util.List<StoryChange> pChanges ) {
298 251 processLazyLoadMutation( mChanges, pChanges );
299 252 }
300 253
301 - public void addChanges( StoryChange pChanges )
302 - {
254 + public void addChanges( StoryChange pChanges ) {
303 255 processLazyLoadMutationAdd( mChanges, pChanges );
304 256 }
305 257
306 - public void removeChanges( StoryChange pChanges )
307 - {
258 + public void removeChanges( StoryChange pChanges ) {
308 259 processLazyLoadMutationRemove( mChanges, pChanges );
309 260 }
310 261
311 262 private static class AttributeAccessor_Changes
312 - extends AttributeAccessorSCDtoManyRegular<StoryUpdate,StoryChange>
313 - {
314 - public AttributeAccessor_Changes()
315 - {
263 + extends AttributeAccessorSCDtoManyRegular<StoryUpdate, StoryChange> {
264 + public AttributeAccessor_Changes() {
316 265 super( "Changes", "ID", StoryChange.class, "Update", null, Mutability.RW, false, true );
317 266 }
318 267
319 268 @Override
320 - public org.litesoft.orsup.lazyload.LazyLoadToManyRegular<StoryUpdate,StoryChange> getValueHolder( StoryUpdate pPO )
321 - {
269 + public org.litesoft.orsup.lazyload.LazyLoadToManyRegular<StoryUpdate, StoryChange> getValueHolder( StoryUpdate pPO ) {
322 270 return pPO.mChanges;
323 271 }
324 272
325 273 @Override
326 - public Object getValueOnPO( StoryUpdate pPO )
327 - {
274 + public Object getValueOnPO( StoryUpdate pPO ) {
328 275 return pPO.getChanges();
329 276 }
330 277
331 278 @Override
332 - public void setValueOnPO( StoryUpdate pPO, Object pValue )
333 - {
279 + public void setValueOnPO( StoryUpdate pPO, Object pValue ) {
334 280 pPO.setChanges( to_POs( pPO, StoryChange.class, pValue ) );
335 281 }
336 282
337 283 @Override
338 - public void addValueOnPO( StoryUpdate pPO, Object pValue )
339 - {
284 + public void addValueOnPO( StoryUpdate pPO, Object pValue ) {
340 285 pPO.addChanges( to_PO( pPO, StoryChange.class, pValue ) );
341 286 }
342 287
343 288 @Override
344 - public void removeValueOnPO( StoryUpdate pPO, Object pValue )
345 - {
289 + public void removeValueOnPO( StoryUpdate pPO, Object pValue ) {
346 290 pPO.removeChanges( to_PO( pPO, StoryChange.class, pValue ) );
347 291 }
348 292 }
349 293
350 294 static class MyMetaData
351 - extends org.litesoft.orsup.nonpublic.PersistentObjectImplMetaData<StoryUpdate>
352 - {
295 + extends org.litesoft.orsup.nonpublic.PersistentObjectImplMetaData<StoryUpdate> {
353 296 public static final String OBJECT_NAME = "StoryUpdate";
354 297 public static final String TABLE_NAME = "StoryUpdate";
355 298
356 - MyMetaData()
357 - {
299 + MyMetaData() {
358 300 super( OBJECT_NAME, TABLE_NAME, new AttributeAccessorKeySet( CD_ID ), //
359 301
360 302 CD_RecordVersion, /* .. */
  @@ -378,50 +320,42 @@
378 320 }
379 321
380 322 @Override
381 - public Class getPOclass()
382 - {
323 + public Class getPOclass() {
383 324 return StoryUpdate.class;
384 325 }
385 326
386 327 @Override
387 - public StoryUpdate createNew( Transaction pTransaction )
388 - {
328 + public StoryUpdate createNew( Transaction pTransaction ) {
389 329 return new StoryUpdate( pTransaction );
390 330 }
391 331
392 332 @Override
393 - public StoryUpdate createPOfromFinder()
394 - {
333 + public StoryUpdate createPOfromFinder() {
395 334 return new StoryUpdate( CONSTRUCTION_CONTROL );
396 335 }
397 336
398 337 @Override
399 - public String getDisplayValueFormat()
400 - {
338 + public String getDisplayValueFormat() {
401 339 return null;
402 340 }
403 341
404 342 @Override
405 - public String getRecordVersionAttributeName()
406 - {
343 + public String getRecordVersionAttributeName() {
407 344 return CD_RecordVersion.getName();
408 345 }
409 346
410 347 @Override
411 - public String getDefaultOrderByAttributeName()
412 - {
348 + public String getDefaultOrderByAttributeName() {
413 349 return "!Created";
414 350 }
415 351
416 352 @Override
417 - public String getCreationTimestampAttributeName()
418 - {
353 + public String getCreationTimestampAttributeName() {
419 354 return CD_Created.getName();
420 355 }
421 356
422 357 @Override
423 - protected void setCreationTimestamp( StoryUpdate pPersistentObject, java.sql.Timestamp pTransactionTimeStamp )
424 - {
358 + protected void setCreationTimestamp( StoryUpdate pPersistentObject, java.sql.Timestamp pTransactionTimeStamp ) {
425 359 pPersistentObject.LLsetCreated( TypeConverter.to_SimpleTimestamp( pTransactionTimeStamp ) );
426 360 }
427 361 }