| 1 | |
|
| 2 | |
|
| 3 | |
package org.melati.poem.generated; |
| 4 | |
|
| 5 | |
|
| 6 | |
import org.melati.poem.AccessPoemException; |
| 7 | |
import org.melati.poem.Capability; |
| 8 | |
import org.melati.poem.Column; |
| 9 | |
import org.melati.poem.Database; |
| 10 | |
import org.melati.poem.DefinitionSource; |
| 11 | |
import org.melati.poem.DisplayLevel; |
| 12 | |
import org.melati.poem.Field; |
| 13 | |
import org.melati.poem.Group; |
| 14 | |
import org.melati.poem.GroupCapability; |
| 15 | |
import org.melati.poem.JdbcPersistent; |
| 16 | |
import org.melati.poem.Persistent; |
| 17 | |
import org.melati.poem.PoemDatabaseTables; |
| 18 | |
import org.melati.poem.PoemException; |
| 19 | |
import org.melati.poem.PoemTable; |
| 20 | |
import org.melati.poem.ReferencePoemType; |
| 21 | |
import org.melati.poem.Searchability; |
| 22 | |
import org.melati.poem.TroidPoemType; |
| 23 | |
import org.melati.poem.ValidationPoemException; |
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
public class GroupCapabilityTableBase<T extends GroupCapability> extends PoemTable<T> { |
| 33 | |
|
| 34 | 64 | private Column<Integer> col_id = null; |
| 35 | 64 | private Column<Integer> col_group = null; |
| 36 | 64 | private Column<Integer> col_capability = null; |
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
public GroupCapabilityTableBase( |
| 49 | |
Database database, String name, |
| 50 | |
DefinitionSource definitionSource) throws PoemException { |
| 51 | 64 | super(database, name, definitionSource); |
| 52 | 64 | } |
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
public PoemDatabaseTables getPoemDatabaseTables() { |
| 62 | 82 | return (PoemDatabaseTables)getDatabase(); |
| 63 | |
} |
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
public void init() throws PoemException { |
| 72 | 41 | super.init(); |
| 73 | 41 | defineColumn(col_id = |
| 74 | |
new Column<Integer>(this, "id", |
| 75 | |
new TroidPoemType(), |
| 76 | 41 | DefinitionSource.dsd) { |
| 77 | |
public Object getCooked(Persistent g) |
| 78 | |
throws AccessPoemException, PoemException { |
| 79 | 0 | return ((GroupCapability)g).getId(); |
| 80 | |
} |
| 81 | |
|
| 82 | |
public void setCooked(Persistent g, Object cooked) |
| 83 | |
throws AccessPoemException, ValidationPoemException { |
| 84 | 0 | ((GroupCapability)g).setId((Integer)cooked); |
| 85 | 0 | } |
| 86 | |
|
| 87 | |
public Field<Integer> asField(Persistent g) { |
| 88 | 0 | return ((GroupCapability)g).getIdField(); |
| 89 | |
} |
| 90 | |
|
| 91 | |
public boolean defaultUserEditable() { |
| 92 | 40 | return false; |
| 93 | |
} |
| 94 | |
|
| 95 | |
public boolean defaultUserCreateable() { |
| 96 | 40 | return false; |
| 97 | |
} |
| 98 | |
|
| 99 | |
public DisplayLevel defaultDisplayLevel() { |
| 100 | 80 | return DisplayLevel.detail; |
| 101 | |
} |
| 102 | |
|
| 103 | |
public int defaultDisplayOrder() { |
| 104 | 40 | return 0; |
| 105 | |
} |
| 106 | |
|
| 107 | |
public String defaultDescription() { |
| 108 | 40 | return "The Table Row Object ID"; |
| 109 | |
} |
| 110 | |
|
| 111 | |
public Object getRaw_unsafe(Persistent g) |
| 112 | |
throws AccessPoemException { |
| 113 | 93 | return ((GroupCapability)g).getId_unsafe(); |
| 114 | |
} |
| 115 | |
|
| 116 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 117 | |
throws AccessPoemException { |
| 118 | 49 | ((GroupCapability)g).setId_unsafe((Integer)raw); |
| 119 | 49 | } |
| 120 | |
|
| 121 | |
public Object getRaw(Persistent g) |
| 122 | |
throws AccessPoemException { |
| 123 | 0 | return ((GroupCapability)g).getId(); |
| 124 | |
} |
| 125 | |
|
| 126 | |
public void setRaw(Persistent g, Object raw) |
| 127 | |
throws AccessPoemException { |
| 128 | 0 | ((GroupCapability)g).setId((Integer)raw); |
| 129 | 0 | } |
| 130 | |
}); |
| 131 | |
|
| 132 | 82 | defineColumn(col_group = |
| 133 | |
new Column<Integer>(this, "group", |
| 134 | 41 | new ReferencePoemType(getPoemDatabaseTables(). |
| 135 | 41 | getGroupTable(), false), |
| 136 | 41 | DefinitionSource.dsd) { |
| 137 | |
public Object getCooked(Persistent g) |
| 138 | |
throws AccessPoemException, PoemException { |
| 139 | 0 | return ((GroupCapability)g).getGroup(); |
| 140 | |
} |
| 141 | |
|
| 142 | |
public void setCooked(Persistent g, Object cooked) |
| 143 | |
throws AccessPoemException, ValidationPoemException { |
| 144 | 0 | ((GroupCapability)g).setGroup((Group)cooked); |
| 145 | 0 | } |
| 146 | |
|
| 147 | |
public Field<Integer> asField(Persistent g) { |
| 148 | 0 | return ((GroupCapability)g).getGroupField(); |
| 149 | |
} |
| 150 | |
|
| 151 | |
public Searchability defaultSearchability() { |
| 152 | 80 | return Searchability.primary; |
| 153 | |
} |
| 154 | |
|
| 155 | |
public Integer defaultDisplayOrderPriority() { |
| 156 | 40 | return new Integer(0); |
| 157 | |
} |
| 158 | |
|
| 159 | |
public int defaultDisplayOrder() { |
| 160 | 40 | return 1; |
| 161 | |
} |
| 162 | |
|
| 163 | |
public String defaultDescription() { |
| 164 | 40 | return "The Group which has the capability"; |
| 165 | |
} |
| 166 | |
|
| 167 | |
public Object getRaw_unsafe(Persistent g) |
| 168 | |
throws AccessPoemException { |
| 169 | 93 | return ((GroupCapability)g).getGroup_unsafe(); |
| 170 | |
} |
| 171 | |
|
| 172 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 173 | |
throws AccessPoemException { |
| 174 | 1 | ((GroupCapability)g).setGroup_unsafe((Integer)raw); |
| 175 | 1 | } |
| 176 | |
|
| 177 | |
public Object getRaw(Persistent g) |
| 178 | |
throws AccessPoemException { |
| 179 | 0 | return ((GroupCapability)g).getGroupTroid(); |
| 180 | |
} |
| 181 | |
|
| 182 | |
public void setRaw(Persistent g, Object raw) |
| 183 | |
throws AccessPoemException { |
| 184 | 0 | ((GroupCapability)g).setGroupTroid((Integer)raw); |
| 185 | 0 | } |
| 186 | |
}); |
| 187 | |
|
| 188 | 82 | defineColumn(col_capability = |
| 189 | |
new Column<Integer>(this, "capability", |
| 190 | 41 | new ReferencePoemType(getPoemDatabaseTables(). |
| 191 | 41 | getCapabilityTable(), false), |
| 192 | 41 | DefinitionSource.dsd) { |
| 193 | |
public Object getCooked(Persistent g) |
| 194 | |
throws AccessPoemException, PoemException { |
| 195 | 0 | return ((GroupCapability)g).getCapability(); |
| 196 | |
} |
| 197 | |
|
| 198 | |
public void setCooked(Persistent g, Object cooked) |
| 199 | |
throws AccessPoemException, ValidationPoemException { |
| 200 | 0 | ((GroupCapability)g).setCapability((Capability)cooked); |
| 201 | 0 | } |
| 202 | |
|
| 203 | |
public Field<Integer> asField(Persistent g) { |
| 204 | 0 | return ((GroupCapability)g).getCapabilityField(); |
| 205 | |
} |
| 206 | |
|
| 207 | |
public Integer defaultDisplayOrderPriority() { |
| 208 | 40 | return new Integer(1); |
| 209 | |
} |
| 210 | |
|
| 211 | |
public int defaultDisplayOrder() { |
| 212 | 40 | return 2; |
| 213 | |
} |
| 214 | |
|
| 215 | |
public String defaultDescription() { |
| 216 | 40 | return "The capability"; |
| 217 | |
} |
| 218 | |
|
| 219 | |
public Object getRaw_unsafe(Persistent g) |
| 220 | |
throws AccessPoemException { |
| 221 | 93 | return ((GroupCapability)g).getCapability_unsafe(); |
| 222 | |
} |
| 223 | |
|
| 224 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 225 | |
throws AccessPoemException { |
| 226 | 1 | ((GroupCapability)g).setCapability_unsafe((Integer)raw); |
| 227 | 1 | } |
| 228 | |
|
| 229 | |
public Object getRaw(Persistent g) |
| 230 | |
throws AccessPoemException { |
| 231 | 0 | return ((GroupCapability)g).getCapabilityTroid(); |
| 232 | |
} |
| 233 | |
|
| 234 | |
public void setRaw(Persistent g, Object raw) |
| 235 | |
throws AccessPoemException { |
| 236 | 0 | ((GroupCapability)g).setCapabilityTroid((Integer)raw); |
| 237 | 0 | } |
| 238 | |
}); |
| 239 | 41 | } |
| 240 | |
|
| 241 | |
|
| 242 | |
|
| 243 | |
|
| 244 | |
|
| 245 | |
|
| 246 | |
|
| 247 | |
|
| 248 | |
|
| 249 | |
public final Column<Integer> getIdColumn() { |
| 250 | 0 | return col_id; |
| 251 | |
} |
| 252 | |
|
| 253 | |
|
| 254 | |
|
| 255 | |
|
| 256 | |
|
| 257 | |
|
| 258 | |
|
| 259 | |
|
| 260 | |
|
| 261 | |
public final Column<Integer> getGroupColumn() { |
| 262 | 49 | return col_group; |
| 263 | |
} |
| 264 | |
|
| 265 | |
|
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
|
| 273 | |
public final Column<Integer> getCapabilityColumn() { |
| 274 | 47 | return col_capability; |
| 275 | |
} |
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | |
|
| 281 | |
|
| 282 | |
|
| 283 | |
|
| 284 | |
|
| 285 | |
public GroupCapability getGroupCapabilityObject(Integer troid) { |
| 286 | 0 | return (GroupCapability)getObject(troid); |
| 287 | |
} |
| 288 | |
|
| 289 | |
|
| 290 | |
|
| 291 | |
|
| 292 | |
|
| 293 | |
|
| 294 | |
|
| 295 | |
|
| 296 | |
|
| 297 | |
public GroupCapability getGroupCapabilityObject(int troid) { |
| 298 | 0 | return (GroupCapability)getObject(troid); |
| 299 | |
} |
| 300 | |
|
| 301 | |
protected JdbcPersistent _newPersistent() { |
| 302 | 45 | return new GroupCapability(); |
| 303 | |
} |
| 304 | |
public String defaultDisplayName() { |
| 305 | 40 | return "Group capability"; |
| 306 | |
} |
| 307 | |
|
| 308 | |
public String defaultDescription() { |
| 309 | 40 | return "A record that Users belonging to a given Group possess a given Capability"; |
| 310 | |
} |
| 311 | |
|
| 312 | |
public String defaultCategory() { |
| 313 | 40 | return "User"; |
| 314 | |
} |
| 315 | |
|
| 316 | |
public int defaultDisplayOrder() { |
| 317 | 40 | return 2050; |
| 318 | |
} |
| 319 | |
} |
| 320 | |
|