| 1 | |
|
| 2 | |
|
| 3 | |
package org.paneris.bibliomania.generated; |
| 4 | |
|
| 5 | |
|
| 6 | |
import org.melati.poem.AccessPoemException; |
| 7 | |
import org.melati.poem.Column; |
| 8 | |
import org.melati.poem.Database; |
| 9 | |
import org.melati.poem.DefinitionSource; |
| 10 | |
import org.melati.poem.DisplayLevel; |
| 11 | |
import org.melati.poem.Field; |
| 12 | |
import org.melati.poem.JdbcPersistent; |
| 13 | |
import org.melati.poem.Persistent; |
| 14 | |
import org.melati.poem.PoemException; |
| 15 | |
import org.melati.poem.ReferencePoemType; |
| 16 | |
import org.melati.poem.Searchability; |
| 17 | |
import org.melati.poem.TroidPoemType; |
| 18 | |
import org.melati.poem.ValidationPoemException; |
| 19 | |
import org.paneris.bibliomania.BibliomaniaDatabaseTables; |
| 20 | |
import org.paneris.bibliomania.BibliomaniaTable; |
| 21 | |
import org.paneris.bibliomania.Product; |
| 22 | |
import org.paneris.bibliomania.Supplier; |
| 23 | |
import org.paneris.bibliomania.SupplierProduct; |
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
public class SupplierProductTableBase<T extends SupplierProduct> extends BibliomaniaTable<T> { |
| 33 | |
|
| 34 | 2 | private Column<Integer> col_id = null; |
| 35 | 2 | private Column<Integer> col_supplier = null; |
| 36 | 2 | private Column<Integer> col_product = null; |
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
public SupplierProductTableBase( |
| 49 | |
Database database, String name, |
| 50 | |
DefinitionSource definitionSource) throws PoemException { |
| 51 | 2 | super(database, name, definitionSource); |
| 52 | 2 | } |
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
| 62 | 4 | return (BibliomaniaDatabaseTables)getDatabase(); |
| 63 | |
} |
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
public void init() throws PoemException { |
| 72 | 2 | super.init(); |
| 73 | 2 | defineColumn(col_id = |
| 74 | |
new Column<Integer>(this, "id", |
| 75 | |
new TroidPoemType(), |
| 76 | 2 | DefinitionSource.dsd) { |
| 77 | |
public Object getCooked(Persistent g) |
| 78 | |
throws AccessPoemException, PoemException { |
| 79 | 0 | return ((SupplierProduct)g).getId(); |
| 80 | |
} |
| 81 | |
|
| 82 | |
public void setCooked(Persistent g, Object cooked) |
| 83 | |
throws AccessPoemException, ValidationPoemException { |
| 84 | 0 | ((SupplierProduct)g).setId((Integer)cooked); |
| 85 | 0 | } |
| 86 | |
|
| 87 | |
public Field<Integer> asField(Persistent g) { |
| 88 | 0 | return ((SupplierProduct)g).getIdField(); |
| 89 | |
} |
| 90 | |
|
| 91 | |
public boolean defaultUserEditable() { |
| 92 | 0 | return false; |
| 93 | |
} |
| 94 | |
|
| 95 | |
public boolean defaultUserCreateable() { |
| 96 | 0 | return false; |
| 97 | |
} |
| 98 | |
|
| 99 | |
public DisplayLevel defaultDisplayLevel() { |
| 100 | 0 | return DisplayLevel.record; |
| 101 | |
} |
| 102 | |
|
| 103 | |
public int defaultDisplayOrder() { |
| 104 | 0 | return 0; |
| 105 | |
} |
| 106 | |
|
| 107 | |
public Object getRaw_unsafe(Persistent g) |
| 108 | |
throws AccessPoemException { |
| 109 | 0 | return ((SupplierProduct)g).getId_unsafe(); |
| 110 | |
} |
| 111 | |
|
| 112 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 113 | |
throws AccessPoemException { |
| 114 | 0 | ((SupplierProduct)g).setId_unsafe((Integer)raw); |
| 115 | 0 | } |
| 116 | |
|
| 117 | |
public Object getRaw(Persistent g) |
| 118 | |
throws AccessPoemException { |
| 119 | 0 | return ((SupplierProduct)g).getId(); |
| 120 | |
} |
| 121 | |
|
| 122 | |
public void setRaw(Persistent g, Object raw) |
| 123 | |
throws AccessPoemException { |
| 124 | 0 | ((SupplierProduct)g).setId((Integer)raw); |
| 125 | 0 | } |
| 126 | |
}); |
| 127 | |
|
| 128 | 2 | defineColumn(col_supplier = |
| 129 | |
new Column<Integer>(this, "supplier", |
| 130 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
| 131 | |
getSupplierTable(), false), |
| 132 | 2 | DefinitionSource.dsd) { |
| 133 | |
public Object getCooked(Persistent g) |
| 134 | |
throws AccessPoemException, PoemException { |
| 135 | 0 | return ((SupplierProduct)g).getSupplier(); |
| 136 | |
} |
| 137 | |
|
| 138 | |
public void setCooked(Persistent g, Object cooked) |
| 139 | |
throws AccessPoemException, ValidationPoemException { |
| 140 | 0 | ((SupplierProduct)g).setSupplier((Supplier)cooked); |
| 141 | 0 | } |
| 142 | |
|
| 143 | |
public Field<Integer> asField(Persistent g) { |
| 144 | 0 | return ((SupplierProduct)g).getSupplierField(); |
| 145 | |
} |
| 146 | |
|
| 147 | |
public DisplayLevel defaultDisplayLevel() { |
| 148 | 0 | return DisplayLevel.summary; |
| 149 | |
} |
| 150 | |
|
| 151 | |
public Searchability defaultSearchability() { |
| 152 | 0 | return Searchability.yes; |
| 153 | |
} |
| 154 | |
|
| 155 | |
public Integer defaultDisplayOrderPriority() { |
| 156 | 0 | return new Integer(1); |
| 157 | |
} |
| 158 | |
|
| 159 | |
public String defaultDisplayName() { |
| 160 | 0 | return "Supplier"; |
| 161 | |
} |
| 162 | |
|
| 163 | |
public int defaultDisplayOrder() { |
| 164 | 0 | return 1; |
| 165 | |
} |
| 166 | |
|
| 167 | |
public String defaultDescription() { |
| 168 | 0 | return "A supplier for this product"; |
| 169 | |
} |
| 170 | |
|
| 171 | |
public boolean defaultIndexed() { |
| 172 | 0 | return true; |
| 173 | |
} |
| 174 | |
|
| 175 | |
public Object getRaw_unsafe(Persistent g) |
| 176 | |
throws AccessPoemException { |
| 177 | 0 | return ((SupplierProduct)g).getSupplier_unsafe(); |
| 178 | |
} |
| 179 | |
|
| 180 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 181 | |
throws AccessPoemException { |
| 182 | 0 | ((SupplierProduct)g).setSupplier_unsafe((Integer)raw); |
| 183 | 0 | } |
| 184 | |
|
| 185 | |
public Object getRaw(Persistent g) |
| 186 | |
throws AccessPoemException { |
| 187 | 0 | return ((SupplierProduct)g).getSupplierTroid(); |
| 188 | |
} |
| 189 | |
|
| 190 | |
public void setRaw(Persistent g, Object raw) |
| 191 | |
throws AccessPoemException { |
| 192 | 0 | ((SupplierProduct)g).setSupplierTroid((Integer)raw); |
| 193 | 0 | } |
| 194 | |
}); |
| 195 | |
|
| 196 | 2 | defineColumn(col_product = |
| 197 | |
new Column<Integer>(this, "product", |
| 198 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
| 199 | |
getProductTable(), false), |
| 200 | 2 | DefinitionSource.dsd) { |
| 201 | |
public Object getCooked(Persistent g) |
| 202 | |
throws AccessPoemException, PoemException { |
| 203 | 0 | return ((SupplierProduct)g).getProduct(); |
| 204 | |
} |
| 205 | |
|
| 206 | |
public void setCooked(Persistent g, Object cooked) |
| 207 | |
throws AccessPoemException, ValidationPoemException { |
| 208 | 0 | ((SupplierProduct)g).setProduct((Product)cooked); |
| 209 | 0 | } |
| 210 | |
|
| 211 | |
public Field<Integer> asField(Persistent g) { |
| 212 | 0 | return ((SupplierProduct)g).getProductField(); |
| 213 | |
} |
| 214 | |
|
| 215 | |
public DisplayLevel defaultDisplayLevel() { |
| 216 | 0 | return DisplayLevel.summary; |
| 217 | |
} |
| 218 | |
|
| 219 | |
public Searchability defaultSearchability() { |
| 220 | 0 | return Searchability.yes; |
| 221 | |
} |
| 222 | |
|
| 223 | |
public Integer defaultDisplayOrderPriority() { |
| 224 | 0 | return new Integer(2); |
| 225 | |
} |
| 226 | |
|
| 227 | |
public String defaultDisplayName() { |
| 228 | 0 | return "Product"; |
| 229 | |
} |
| 230 | |
|
| 231 | |
public int defaultDisplayOrder() { |
| 232 | 0 | return 2; |
| 233 | |
} |
| 234 | |
|
| 235 | |
public String defaultDescription() { |
| 236 | 0 | return "A product for this supplier"; |
| 237 | |
} |
| 238 | |
|
| 239 | |
public boolean defaultIndexed() { |
| 240 | 0 | return true; |
| 241 | |
} |
| 242 | |
|
| 243 | |
public Object getRaw_unsafe(Persistent g) |
| 244 | |
throws AccessPoemException { |
| 245 | 0 | return ((SupplierProduct)g).getProduct_unsafe(); |
| 246 | |
} |
| 247 | |
|
| 248 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 249 | |
throws AccessPoemException { |
| 250 | 0 | ((SupplierProduct)g).setProduct_unsafe((Integer)raw); |
| 251 | 0 | } |
| 252 | |
|
| 253 | |
public Object getRaw(Persistent g) |
| 254 | |
throws AccessPoemException { |
| 255 | 0 | return ((SupplierProduct)g).getProductTroid(); |
| 256 | |
} |
| 257 | |
|
| 258 | |
public void setRaw(Persistent g, Object raw) |
| 259 | |
throws AccessPoemException { |
| 260 | 0 | ((SupplierProduct)g).setProductTroid((Integer)raw); |
| 261 | 0 | } |
| 262 | |
}); |
| 263 | 2 | } |
| 264 | |
|
| 265 | |
|
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
|
| 273 | |
public final Column<Integer> getIdColumn() { |
| 274 | 0 | return col_id; |
| 275 | |
} |
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | |
|
| 281 | |
|
| 282 | |
|
| 283 | |
|
| 284 | |
|
| 285 | |
public final Column<Integer> getSupplierColumn() { |
| 286 | 0 | return col_supplier; |
| 287 | |
} |
| 288 | |
|
| 289 | |
|
| 290 | |
|
| 291 | |
|
| 292 | |
|
| 293 | |
|
| 294 | |
|
| 295 | |
|
| 296 | |
|
| 297 | |
public final Column<Integer> getProductColumn() { |
| 298 | 0 | return col_product; |
| 299 | |
} |
| 300 | |
|
| 301 | |
|
| 302 | |
|
| 303 | |
|
| 304 | |
|
| 305 | |
|
| 306 | |
|
| 307 | |
|
| 308 | |
|
| 309 | |
public SupplierProduct getSupplierProductObject(Integer troid) { |
| 310 | 0 | return (SupplierProduct)getObject(troid); |
| 311 | |
} |
| 312 | |
|
| 313 | |
|
| 314 | |
|
| 315 | |
|
| 316 | |
|
| 317 | |
|
| 318 | |
|
| 319 | |
|
| 320 | |
|
| 321 | |
public SupplierProduct getSupplierProductObject(int troid) { |
| 322 | 0 | return (SupplierProduct)getObject(troid); |
| 323 | |
} |
| 324 | |
|
| 325 | |
protected JdbcPersistent _newPersistent() { |
| 326 | 0 | return new SupplierProduct(); |
| 327 | |
} |
| 328 | |
public String defaultDisplayName() { |
| 329 | 0 | return "Supplier's Products"; |
| 330 | |
} |
| 331 | |
|
| 332 | |
public String defaultDescription() { |
| 333 | 0 | return "A record that a product is supplied by the given supplier"; |
| 334 | |
} |
| 335 | |
|
| 336 | |
public boolean defaultRememberAllTroids() { |
| 337 | 0 | return true; |
| 338 | |
} |
| 339 | |
|
| 340 | |
public Integer defaultCacheLimit() { |
| 341 | 0 | return new Integer(999999999); |
| 342 | |
} |
| 343 | |
|
| 344 | |
public String defaultCategory() { |
| 345 | 0 | return "Shop"; |
| 346 | |
} |
| 347 | |
|
| 348 | |
public int defaultDisplayOrder() { |
| 349 | 0 | return 1220; |
| 350 | |
} |
| 351 | |
} |
| 352 | |
|