| 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.StringPoemType; |
| 16 | |
import org.melati.poem.TroidPoemType; |
| 17 | |
import org.melati.poem.ValidationPoemException; |
| 18 | |
import org.paneris.bibliomania.BibliomaniaDatabaseTables; |
| 19 | |
import org.paneris.bibliomania.BibliomaniaTable; |
| 20 | |
import org.paneris.bibliomania.BookFormat; |
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
public class BookFormatTableBase<T extends BookFormat> extends BibliomaniaTable<T> { |
| 30 | |
|
| 31 | 2 | private Column<Integer> col_id = null; |
| 32 | 2 | private Column<String> col_displayname = null; |
| 33 | 2 | private Column<String> col_descriptionregexp = null; |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
public BookFormatTableBase( |
| 46 | |
Database database, String name, |
| 47 | |
DefinitionSource definitionSource) throws PoemException { |
| 48 | 2 | super(database, name, definitionSource); |
| 49 | 2 | } |
| 50 | |
|
| 51 | |
|
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
| 59 | 0 | return (BibliomaniaDatabaseTables)getDatabase(); |
| 60 | |
} |
| 61 | |
|
| 62 | |
|
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
public void init() throws PoemException { |
| 69 | 2 | super.init(); |
| 70 | 2 | defineColumn(col_id = |
| 71 | |
new Column<Integer>(this, "id", |
| 72 | |
new TroidPoemType(), |
| 73 | 2 | DefinitionSource.dsd) { |
| 74 | |
public Object getCooked(Persistent g) |
| 75 | |
throws AccessPoemException, PoemException { |
| 76 | 0 | return ((BookFormat)g).getId(); |
| 77 | |
} |
| 78 | |
|
| 79 | |
public void setCooked(Persistent g, Object cooked) |
| 80 | |
throws AccessPoemException, ValidationPoemException { |
| 81 | 0 | ((BookFormat)g).setId((Integer)cooked); |
| 82 | 0 | } |
| 83 | |
|
| 84 | |
public Field<Integer> asField(Persistent g) { |
| 85 | 0 | return ((BookFormat)g).getIdField(); |
| 86 | |
} |
| 87 | |
|
| 88 | |
public boolean defaultUserEditable() { |
| 89 | 0 | return false; |
| 90 | |
} |
| 91 | |
|
| 92 | |
public boolean defaultUserCreateable() { |
| 93 | 0 | return false; |
| 94 | |
} |
| 95 | |
|
| 96 | |
public DisplayLevel defaultDisplayLevel() { |
| 97 | 0 | return DisplayLevel.record; |
| 98 | |
} |
| 99 | |
|
| 100 | |
public int defaultDisplayOrder() { |
| 101 | 0 | return 0; |
| 102 | |
} |
| 103 | |
|
| 104 | |
public Object getRaw_unsafe(Persistent g) |
| 105 | |
throws AccessPoemException { |
| 106 | 0 | return ((BookFormat)g).getId_unsafe(); |
| 107 | |
} |
| 108 | |
|
| 109 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 110 | |
throws AccessPoemException { |
| 111 | 0 | ((BookFormat)g).setId_unsafe((Integer)raw); |
| 112 | 0 | } |
| 113 | |
|
| 114 | |
public Object getRaw(Persistent g) |
| 115 | |
throws AccessPoemException { |
| 116 | 0 | return ((BookFormat)g).getId(); |
| 117 | |
} |
| 118 | |
|
| 119 | |
public void setRaw(Persistent g, Object raw) |
| 120 | |
throws AccessPoemException { |
| 121 | 0 | ((BookFormat)g).setId((Integer)raw); |
| 122 | 0 | } |
| 123 | |
}); |
| 124 | |
|
| 125 | 2 | defineColumn(col_displayname = |
| 126 | |
new Column<String>(this, "displayname", |
| 127 | |
new StringPoemType(false, -1), |
| 128 | 2 | DefinitionSource.dsd) { |
| 129 | |
public Object getCooked(Persistent g) |
| 130 | |
throws AccessPoemException, PoemException { |
| 131 | 0 | return ((BookFormat)g).getDisplayname(); |
| 132 | |
} |
| 133 | |
|
| 134 | |
public void setCooked(Persistent g, Object cooked) |
| 135 | |
throws AccessPoemException, ValidationPoemException { |
| 136 | 0 | ((BookFormat)g).setDisplayname((String)cooked); |
| 137 | 0 | } |
| 138 | |
|
| 139 | |
public Field<String> asField(Persistent g) { |
| 140 | 0 | return ((BookFormat)g).getDisplaynameField(); |
| 141 | |
} |
| 142 | |
|
| 143 | |
public DisplayLevel defaultDisplayLevel() { |
| 144 | 0 | return DisplayLevel.primary; |
| 145 | |
} |
| 146 | |
|
| 147 | |
public String defaultDisplayName() { |
| 148 | 0 | return "Display name"; |
| 149 | |
} |
| 150 | |
|
| 151 | |
public int defaultDisplayOrder() { |
| 152 | 0 | return 1; |
| 153 | |
} |
| 154 | |
|
| 155 | |
public String defaultDescription() { |
| 156 | 0 | return "A name for the format"; |
| 157 | |
} |
| 158 | |
|
| 159 | |
public Object getRaw_unsafe(Persistent g) |
| 160 | |
throws AccessPoemException { |
| 161 | 0 | return ((BookFormat)g).getDisplayname_unsafe(); |
| 162 | |
} |
| 163 | |
|
| 164 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 165 | |
throws AccessPoemException { |
| 166 | 0 | ((BookFormat)g).setDisplayname_unsafe((String)raw); |
| 167 | 0 | } |
| 168 | |
|
| 169 | |
public Object getRaw(Persistent g) |
| 170 | |
throws AccessPoemException { |
| 171 | 0 | return ((BookFormat)g).getDisplayname(); |
| 172 | |
} |
| 173 | |
|
| 174 | |
public void setRaw(Persistent g, Object raw) |
| 175 | |
throws AccessPoemException { |
| 176 | 0 | ((BookFormat)g).setDisplayname((String)raw); |
| 177 | 0 | } |
| 178 | |
}); |
| 179 | |
|
| 180 | 2 | defineColumn(col_descriptionregexp = |
| 181 | |
new Column<String>(this, "descriptionregexp", |
| 182 | |
new StringPoemType(false, -1), |
| 183 | 2 | DefinitionSource.dsd) { |
| 184 | |
public Object getCooked(Persistent g) |
| 185 | |
throws AccessPoemException, PoemException { |
| 186 | 0 | return ((BookFormat)g).getDescriptionregexp(); |
| 187 | |
} |
| 188 | |
|
| 189 | |
public void setCooked(Persistent g, Object cooked) |
| 190 | |
throws AccessPoemException, ValidationPoemException { |
| 191 | 0 | ((BookFormat)g).setDescriptionregexp((String)cooked); |
| 192 | 0 | } |
| 193 | |
|
| 194 | |
public Field<String> asField(Persistent g) { |
| 195 | 0 | return ((BookFormat)g).getDescriptionregexpField(); |
| 196 | |
} |
| 197 | |
|
| 198 | |
public String defaultDisplayName() { |
| 199 | 0 | return "Description regexp"; |
| 200 | |
} |
| 201 | |
|
| 202 | |
public int defaultDisplayOrder() { |
| 203 | 0 | return 2; |
| 204 | |
} |
| 205 | |
|
| 206 | |
public String defaultDescription() { |
| 207 | 0 | return "A regular expression pattern for matching the different ways bookshops describe the format"; |
| 208 | |
} |
| 209 | |
|
| 210 | |
public Object getRaw_unsafe(Persistent g) |
| 211 | |
throws AccessPoemException { |
| 212 | 0 | return ((BookFormat)g).getDescriptionregexp_unsafe(); |
| 213 | |
} |
| 214 | |
|
| 215 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 216 | |
throws AccessPoemException { |
| 217 | 0 | ((BookFormat)g).setDescriptionregexp_unsafe((String)raw); |
| 218 | 0 | } |
| 219 | |
|
| 220 | |
public Object getRaw(Persistent g) |
| 221 | |
throws AccessPoemException { |
| 222 | 0 | return ((BookFormat)g).getDescriptionregexp(); |
| 223 | |
} |
| 224 | |
|
| 225 | |
public void setRaw(Persistent g, Object raw) |
| 226 | |
throws AccessPoemException { |
| 227 | 0 | ((BookFormat)g).setDescriptionregexp((String)raw); |
| 228 | 0 | } |
| 229 | |
}); |
| 230 | 2 | } |
| 231 | |
|
| 232 | |
|
| 233 | |
|
| 234 | |
|
| 235 | |
|
| 236 | |
|
| 237 | |
|
| 238 | |
|
| 239 | |
|
| 240 | |
public final Column<Integer> getIdColumn() { |
| 241 | 0 | return col_id; |
| 242 | |
} |
| 243 | |
|
| 244 | |
|
| 245 | |
|
| 246 | |
|
| 247 | |
|
| 248 | |
|
| 249 | |
|
| 250 | |
|
| 251 | |
|
| 252 | |
public final Column<String> getDisplaynameColumn() { |
| 253 | 0 | return col_displayname; |
| 254 | |
} |
| 255 | |
|
| 256 | |
|
| 257 | |
|
| 258 | |
|
| 259 | |
|
| 260 | |
|
| 261 | |
|
| 262 | |
|
| 263 | |
|
| 264 | |
public final Column<String> getDescriptionregexpColumn() { |
| 265 | 0 | return col_descriptionregexp; |
| 266 | |
} |
| 267 | |
|
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
|
| 273 | |
|
| 274 | |
|
| 275 | |
|
| 276 | |
public BookFormat getBookFormatObject(Integer troid) { |
| 277 | 0 | return (BookFormat)getObject(troid); |
| 278 | |
} |
| 279 | |
|
| 280 | |
|
| 281 | |
|
| 282 | |
|
| 283 | |
|
| 284 | |
|
| 285 | |
|
| 286 | |
|
| 287 | |
|
| 288 | |
public BookFormat getBookFormatObject(int troid) { |
| 289 | 0 | return (BookFormat)getObject(troid); |
| 290 | |
} |
| 291 | |
|
| 292 | |
protected JdbcPersistent _newPersistent() { |
| 293 | 0 | return new BookFormat(); |
| 294 | |
} |
| 295 | |
public String defaultDisplayName() { |
| 296 | 0 | return "Book format"; |
| 297 | |
} |
| 298 | |
|
| 299 | |
public String defaultDescription() { |
| 300 | 0 | return "The format of a book stocked by a shop"; |
| 301 | |
} |
| 302 | |
|
| 303 | |
public boolean defaultRememberAllTroids() { |
| 304 | 0 | return true; |
| 305 | |
} |
| 306 | |
|
| 307 | |
public Integer defaultCacheLimit() { |
| 308 | 0 | return new Integer(999999999); |
| 309 | |
} |
| 310 | |
|
| 311 | |
public String defaultCategory() { |
| 312 | 0 | return "Comparison Shopper"; |
| 313 | |
} |
| 314 | |
|
| 315 | |
public int defaultDisplayOrder() { |
| 316 | 0 | return 1310; |
| 317 | |
} |
| 318 | |
} |
| 319 | |
|