litesoft
Diff Revisions
193
vs
222
for /trunk/Java/PoVoGenerator/Generator/src/org/litesoft/generator/GeneratePOGO.java
|
@@ -204,6 +204,16 @@ |
204 |
204 |
|
addMethodPublic( "String", "getRecordVersionAttributeName" ); |
205 |
205 |
|
addLine( "return CD_RecordVersion.getName();" ); |
206 |
206 |
|
addBlockEnd(); |
|
207 |
+ |
|
|
208 |
+ |
String zOrderBy = UtilsCommon.noEmpty( mObjectMetaData.getPropertyManager().get_String( PMD_OrderByAttribute.NAME, null ) ); |
|
209 |
+ |
if ( zOrderBy != null ) |
|
210 |
+ |
{ |
|
211 |
+ |
addBlankLine(); |
|
212 |
+ |
addLine( "@Override" ); |
|
213 |
+ |
addMethodPublic( "String", "getDefaultOrderByAttributeName" ); |
|
214 |
+ |
addLine( "return \"" + zOrderBy + "\";" ); |
|
215 |
+ |
addBlockEnd(); |
|
216 |
+ |
} |
207 |
217 |
|
} |
208 |
218 |
|
String zTimeTracked = mObjectMetaData.getPropertyManager().get_String( PMD_TimeTracked.NAME, PMD_TimeTracked.NONE ); |
209 |
219 |
|
if ( PMD_TimeTracked.CREATED.equals( zTimeTracked ) || PMD_TimeTracked.BOTH.equals( zTimeTracked ) ) |
|
@@ -1279,15 +1289,23 @@ |
1279 |
1289 |
|
addClassDefinition( "AttributeAccessor_" + zName, zAAtype ); |
1280 |
1290 |
|
|
1281 |
1291 |
|
addConstructorPublic( "AttributeAccessor_" + zName ); |
|
1292 |
+ |
|
|
1293 |
+ |
String zOrderBy = UtilsCommon.noEmpty( pAttribute.getPropertyManager().get_String( PMD_OrderByAttribute.NAME, null ) ); |
|
1294 |
+ |
if ( zOrderBy != null ) |
|
1295 |
+ |
{ |
|
1296 |
+ |
zOrderBy = "\"" + zOrderBy + "\""; |
|
1297 |
+ |
} |
1282 |
1298 |
|
if ( "Variable".equals( pForm ) ) |
1283 |
1299 |
|
{ |
1284 |
|
- |
addLine( "super( \"" + zName + "\", " + zToMany + ".class, \"" + pAttribute.getToManyBackReference() + "\", null, " + // OrderBy Attribute |
|
1300 |
+ |
addLine( "super( \"" + zName + "\", " + zToMany + ".class, \"" + pAttribute.getToManyBackReference() + "\", " + // |
|
1301 |
+ |
zOrderBy + ", " + // |
1285 |
1302 |
|
pCascadeDeleteThem + ", " + pAttribute.isRequired() + ", " + // |
1286 |
1303 |
|
"Mutability." + zMutability + " );" ); |
1287 |
1304 |
|
} |
1288 |
1305 |
|
else |
1289 |
1306 |
|
{ |
1290 |
|
- |
addLine( "super( \"" + zName + "\", \"ID\", " + zToMany + ".class, \"" + pAttribute.getToManyBackReference() + "\", null, " + // OrderBy Attribute |
|
1307 |
+ |
addLine( "super( \"" + zName + "\", \"ID\", " + zToMany + ".class, \"" + pAttribute.getToManyBackReference() + "\", " + // |
|
1308 |
+ |
zOrderBy + ", " + // |
1291 |
1309 |
|
"Mutability." + zMutability + ", " + pAttribute.isRequired() + ", " + // |
1292 |
1310 |
|
pCascadeDeleteThem + " );" ); |
1293 |
1311 |
|
} |