litesoft
@ HEAD
litesoft / trunk / GWT_Sandbox / Prioritizer / src / org / litesoft / prioritizer / server / pos / DeviceGO.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
package org.litesoft.prioritizer.server.pos; import org.litesoft.bo.attributes.*; import org.litesoft.core.util.*; import org.litesoft.orsup.base.*; import org.litesoft.orsup.otherattributeaccessors.*; import org.litesoft.orsup.selection.*; import org.litesoft.orsup.transact.*; public abstract class DeviceGO extends org.litesoft.orsup.nonpublic.PersistentObjectImpl<Device> implements HasAttributes { private static final ConstructionControl CONSTRUCTION_CONTROL = new ConstructionControl(); public static SimpleFromIdentifier from() { return DeviceMetaData.INSTANCE; } protected DeviceGO( Transaction pTransaction ) { super( DeviceMetaData.INSTANCE, pTransaction ); mID = getNextSequenceNumber( getClass() ); registerWithTransaction(); setDefaults(); } protected DeviceGO( ConstructionControl pConstructionControl ) { super( DeviceMetaData.INSTANCE, CONSTRUCTION_CONTROL, pConstructionControl ); } public static final AttributeAccessorSCD CD_RecordVersion = new AttributeAccessor_RecordVersion(); protected final RecordVersionHelper mRecordVersion = new RecordVersionHelper(); public Long getRecordVersion() { return mRecordVersion.getRecordVersion(); } private static class AttributeAccessor_RecordVersion extends AttributeAccessorSCD_RecordVersion<Device> { public AttributeAccessor_RecordVersion() { super( "RecordVersion", "RecordVersion" ); } @Override protected RecordVersionHelper getRecordVersionHelper( Device pPO ) { return pPO.mRecordVersion; } } public static final AttributeAccessorSCD CD_ID = new AttributeAccessor_ID(); private Long mID; public Long getID() { return mID; } protected void LLsetID( Long pID ) { verifyMutability( CD_ID, mID, pID ); mID = pID; } private static class AttributeAccessor_ID extends AttributeAccessorSCDsimplePersistedSysSetOnly<Device> implements NonImportableFeature { public AttributeAccessor_ID() { super( "ID", "ID", false, _Long.AddOnly() ); } @Override public Object getValueOnPO( Device pPO ) { return pPO.getID(); } @Override public void db_setValueOnPO( Device pPO, Object pValue ) { pPO.LLsetID( to_Long( pValue ) ); } } public static final AttributeAccessorSCD CD_Hostname = new AttributeAccessor_Hostname(); private String mHostname; public String getHostname() { return mHostname; } public void setHostname( String pHostname ) { verifyMutability( CD_Hostname, mHostname, pHostname ); mHostname = pHostname; } private static class AttributeAccessor_Hostname extends AttributeAccessorSCDsimplePersistedRegular<Device> { public AttributeAccessor_Hostname() { super( "Hostname", "Hostname", true, _String.with( MaxLength.of( 40 ), // DisplayLength.of( 20 ) ) ); } @Override public Object getValueOnPO( Device pPO ) { return pPO.getHostname(); } @Override public void setValueOnPO( Device pPO, Object pValue ) { pPO.setHostname( to_String( pValue ) ); } } public static final AttributeAccessorSCD CD_Location = new AttributeAccessor_Location(); private String mLocation; public String getLocation() { return mLocation; } public void setLocation( String pLocation ) { verifyMutability( CD_Location, mLocation, pLocation ); mLocation = pLocation; } private static class AttributeAccessor_Location extends AttributeAccessorSCDsimplePersistedRegular<Device> { public AttributeAccessor_Location() { super( "Location", "Location", false, _String.with( MaxLength.of( 40 ), // DisplayLength.of( 20 ) ) ); } @Override public Object getValueOnPO( Device pPO ) { return pPO.getLocation(); } @Override public void setValueOnPO( Device pPO, Object pValue ) { pPO.setLocation( to_String( pValue ) ); } } static class MyMetaData extends org.litesoft.orsup.nonpublic.PersistentObjectImplMetaData<Device> { public static final String OBJECT_NAME = "Device"; public static final String TABLE_NAME = "Device"; MyMetaData() { super( OBJECT_NAME, TABLE_NAME, new AttributeAccessorKeySet( CD_ID ), // CD_RecordVersion, /* .. */ CD_ID, /* ............. */ // Regular CD_Hostname, /* ....... Required */ CD_Location /* ........ */ ); setIndexes( new Index( "DeviceMUGIDX1", null, true, CD_Hostname ) ); } @Override public Class getPOclass() { return Device.class; } @Override public Device createNew( Transaction pTransaction ) { return new Device( pTransaction ); } @Override public Device createPOfromFinder() { return new Device( CONSTRUCTION_CONTROL ); } @Override public String getDisplayValueFormat() { return "${Hostname}"; } @Override public String getRecordVersionAttributeName() { return CD_RecordVersion.getName(); } } } |