|
@@ -9,25 +9,21 @@ |
9 |
9 |
|
|
10 |
10 |
|
public abstract class DeviceGO |
11 |
11 |
|
extends org.litesoft.orsup.nonpublic.PersistentObjectImpl<Device> |
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 DeviceMetaData.INSTANCE; |
19 |
17 |
|
} |
20 |
18 |
|
|
21 |
|
- |
protected DeviceGO( Transaction pTransaction ) |
22 |
|
- |
{ |
|
19 |
+ |
protected DeviceGO( Transaction pTransaction ) { |
23 |
20 |
|
super( DeviceMetaData.INSTANCE, pTransaction ); |
24 |
21 |
|
mID = getNextSequenceNumber( getClass() ); |
25 |
22 |
|
registerWithTransaction(); |
26 |
23 |
|
setDefaults(); |
27 |
24 |
|
} |
28 |
25 |
|
|
29 |
|
- |
protected DeviceGO( ConstructionControl pConstructionControl ) |
30 |
|
- |
{ |
|
26 |
+ |
protected DeviceGO( ConstructionControl pConstructionControl ) { |
31 |
27 |
|
super( DeviceMetaData.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<Device> |
45 |
|
- |
{ |
46 |
|
- |
public AttributeAccessor_RecordVersion() |
47 |
|
- |
{ |
|
39 |
+ |
extends AttributeAccessorSCD_RecordVersion<Device> { |
|
40 |
+ |
public AttributeAccessor_RecordVersion() { |
48 |
41 |
|
super( "RecordVersion", "RecordVersion" ); |
49 |
42 |
|
} |
50 |
43 |
|
|
51 |
44 |
|
@Override |
52 |
|
- |
protected RecordVersionHelper getRecordVersionHelper( Device pPO ) |
53 |
|
- |
{ |
|
45 |
+ |
protected RecordVersionHelper getRecordVersionHelper( Device pPO ) { |
54 |
46 |
|
return pPO.mRecordVersion; |
55 |
47 |
|
} |
56 |
48 |
|
} |
|
@@ -59,35 +51,29 @@ |
59 |
51 |
|
|
60 |
52 |
|
private Long mID; |
61 |
53 |
|
|
62 |
|
- |
public Long getID() |
63 |
|
- |
{ |
|
54 |
+ |
public Long getID() { |
64 |
55 |
|
return mID; |
65 |
56 |
|
} |
66 |
57 |
|
|
67 |
|
- |
protected void LLsetID( Long pID ) |
68 |
|
- |
{ |
|
58 |
+ |
protected void LLsetID( Long pID ) { |
69 |
59 |
|
verifyMutability( CD_ID, mID, pID ); |
70 |
60 |
|
mID = pID; |
71 |
61 |
|
} |
72 |
62 |
|
|
73 |
63 |
|
private static class AttributeAccessor_ID |
74 |
64 |
|
extends AttributeAccessorSCDsimplePersistedSysSetOnly<Device> |
75 |
|
- |
implements NonImportableFeature |
76 |
|
- |
{ |
77 |
|
- |
public AttributeAccessor_ID() |
78 |
|
- |
{ |
|
65 |
+ |
implements NonImportableFeature { |
|
66 |
+ |
public AttributeAccessor_ID() { |
79 |
67 |
|
super( "ID", "ID", false, _Long.AddOnly() ); |
80 |
68 |
|
} |
81 |
69 |
|
|
82 |
70 |
|
@Override |
83 |
|
- |
public Object getValueOnPO( Device pPO ) |
84 |
|
- |
{ |
|
71 |
+ |
public Object getValueOnPO( Device pPO ) { |
85 |
72 |
|
return pPO.getID(); |
86 |
73 |
|
} |
87 |
74 |
|
|
88 |
75 |
|
@Override |
89 |
|
- |
public void db_setValueOnPO( Device pPO, Object pValue ) |
90 |
|
- |
{ |
|
76 |
+ |
public void db_setValueOnPO( Device pPO, Object pValue ) { |
91 |
77 |
|
pPO.LLsetID( to_Long( pValue ) ); |
92 |
78 |
|
} |
93 |
79 |
|
} |
|
@@ -96,35 +82,29 @@ |
96 |
82 |
|
|
97 |
83 |
|
private String mHostname; |
98 |
84 |
|
|
99 |
|
- |
public String getHostname() |
100 |
|
- |
{ |
|
85 |
+ |
public String getHostname() { |
101 |
86 |
|
return mHostname; |
102 |
87 |
|
} |
103 |
88 |
|
|
104 |
|
- |
public void setHostname( String pHostname ) |
105 |
|
- |
{ |
|
89 |
+ |
public void setHostname( String pHostname ) { |
106 |
90 |
|
verifyMutability( CD_Hostname, mHostname, pHostname ); |
107 |
91 |
|
mHostname = pHostname; |
108 |
92 |
|
} |
109 |
93 |
|
|
110 |
94 |
|
private static class AttributeAccessor_Hostname |
111 |
|
- |
extends AttributeAccessorSCDsimplePersistedRegular<Device> |
112 |
|
- |
{ |
113 |
|
- |
public AttributeAccessor_Hostname() |
114 |
|
- |
{ |
|
95 |
+ |
extends AttributeAccessorSCDsimplePersistedRegular<Device> { |
|
96 |
+ |
public AttributeAccessor_Hostname() { |
115 |
97 |
|
super( "Hostname", "Hostname", true, _String.with( MaxLength.of( 40 ), // |
116 |
98 |
|
DisplayLength.of( 20 ) ) ); |
117 |
99 |
|
} |
118 |
100 |
|
|
119 |
101 |
|
@Override |
120 |
|
- |
public Object getValueOnPO( Device pPO ) |
121 |
|
- |
{ |
|
102 |
+ |
public Object getValueOnPO( Device pPO ) { |
122 |
103 |
|
return pPO.getHostname(); |
123 |
104 |
|
} |
124 |
105 |
|
|
125 |
106 |
|
@Override |
126 |
|
- |
public void setValueOnPO( Device pPO, Object pValue ) |
127 |
|
- |
{ |
|
107 |
+ |
public void setValueOnPO( Device pPO, Object pValue ) { |
128 |
108 |
|
pPO.setHostname( to_String( pValue ) ); |
129 |
109 |
|
} |
130 |
110 |
|
} |
|
@@ -133,47 +113,39 @@ |
133 |
113 |
|
|
134 |
114 |
|
private String mLocation; |
135 |
115 |
|
|
136 |
|
- |
public String getLocation() |
137 |
|
- |
{ |
|
116 |
+ |
public String getLocation() { |
138 |
117 |
|
return mLocation; |
139 |
118 |
|
} |
140 |
119 |
|
|
141 |
|
- |
public void setLocation( String pLocation ) |
142 |
|
- |
{ |
|
120 |
+ |
public void setLocation( String pLocation ) { |
143 |
121 |
|
verifyMutability( CD_Location, mLocation, pLocation ); |
144 |
122 |
|
mLocation = pLocation; |
145 |
123 |
|
} |
146 |
124 |
|
|
147 |
125 |
|
private static class AttributeAccessor_Location |
148 |
|
- |
extends AttributeAccessorSCDsimplePersistedRegular<Device> |
149 |
|
- |
{ |
150 |
|
- |
public AttributeAccessor_Location() |
151 |
|
- |
{ |
|
126 |
+ |
extends AttributeAccessorSCDsimplePersistedRegular<Device> { |
|
127 |
+ |
public AttributeAccessor_Location() { |
152 |
128 |
|
super( "Location", "Location", false, _String.with( MaxLength.of( 40 ), // |
153 |
129 |
|
DisplayLength.of( 20 ) ) ); |
154 |
130 |
|
} |
155 |
131 |
|
|
156 |
132 |
|
@Override |
157 |
|
- |
public Object getValueOnPO( Device pPO ) |
158 |
|
- |
{ |
|
133 |
+ |
public Object getValueOnPO( Device pPO ) { |
159 |
134 |
|
return pPO.getLocation(); |
160 |
135 |
|
} |
161 |
136 |
|
|
162 |
137 |
|
@Override |
163 |
|
- |
public void setValueOnPO( Device pPO, Object pValue ) |
164 |
|
- |
{ |
|
138 |
+ |
public void setValueOnPO( Device pPO, Object pValue ) { |
165 |
139 |
|
pPO.setLocation( to_String( pValue ) ); |
166 |
140 |
|
} |
167 |
141 |
|
} |
168 |
142 |
|
|
169 |
143 |
|
static class MyMetaData |
170 |
|
- |
extends org.litesoft.orsup.nonpublic.PersistentObjectImplMetaData<Device> |
171 |
|
- |
{ |
|
144 |
+ |
extends org.litesoft.orsup.nonpublic.PersistentObjectImplMetaData<Device> { |
172 |
145 |
|
public static final String OBJECT_NAME = "Device"; |
173 |
146 |
|
public static final String TABLE_NAME = "Device"; |
174 |
147 |
|
|
175 |
|
- |
MyMetaData() |
176 |
|
- |
{ |
|
148 |
+ |
MyMetaData() { |
177 |
149 |
|
super( OBJECT_NAME, TABLE_NAME, new AttributeAccessorKeySet( CD_ID ), // |
178 |
150 |
|
|
179 |
151 |
|
CD_RecordVersion, /* .. */ |
|
@@ -187,32 +159,27 @@ |
187 |
159 |
|
} |
188 |
160 |
|
|
189 |
161 |
|
@Override |
190 |
|
- |
public Class getPOclass() |
191 |
|
- |
{ |
|
162 |
+ |
public Class getPOclass() { |
192 |
163 |
|
return Device.class; |
193 |
164 |
|
} |
194 |
165 |
|
|
195 |
166 |
|
@Override |
196 |
|
- |
public Device createNew( Transaction pTransaction ) |
197 |
|
- |
{ |
|
167 |
+ |
public Device createNew( Transaction pTransaction ) { |
198 |
168 |
|
return new Device( pTransaction ); |
199 |
169 |
|
} |
200 |
170 |
|
|
201 |
171 |
|
@Override |
202 |
|
- |
public Device createPOfromFinder() |
203 |
|
- |
{ |
|
172 |
+ |
public Device createPOfromFinder() { |
204 |
173 |
|
return new Device( CONSTRUCTION_CONTROL ); |
205 |
174 |
|
} |
206 |
175 |
|
|
207 |
176 |
|
@Override |
208 |
|
- |
public String getDisplayValueFormat() |
209 |
|
- |
{ |
|
177 |
+ |
public String getDisplayValueFormat() { |
210 |
178 |
|
return "${Hostname}"; |
211 |
179 |
|
} |
212 |
180 |
|
|
213 |
181 |
|
@Override |
214 |
|
- |
public String getRecordVersionAttributeName() |
215 |
|
- |
{ |
|
182 |
+ |
public String getRecordVersionAttributeName() { |
216 |
183 |
|
return CD_RecordVersion.getName(); |
217 |
184 |
|
} |
218 |
185 |
|
} |