| 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.Campaign; | 
  | 22 |  |  import org.paneris.bibliomania.CampaignUser; | 
  | 23 |  |   | 
  | 24 |  |  import org.paneris.bibliomania.User; | 
  | 25 |  |   | 
  | 26 |  |   | 
  | 27 |  |   | 
  | 28 |  |   | 
  | 29 |  |   | 
  | 30 |  |   | 
  | 31 |  |   | 
  | 32 |  |   | 
  | 33 |  |  public class CampaignUserTableBase<T extends CampaignUser> extends BibliomaniaTable<T> { | 
  | 34 |  |   | 
  | 35 | 2 |    private Column<Integer> col_id = null; | 
  | 36 | 2 |    private Column<Integer> col_campaign = null; | 
  | 37 | 2 |    private Column<Integer> col_user = null; | 
  | 38 |  |   | 
  | 39 |  |    | 
  | 40 |  |   | 
  | 41 |  |   | 
  | 42 |  |   | 
  | 43 |  |   | 
  | 44 |  |   | 
  | 45 |  |   | 
  | 46 |  |   | 
  | 47 |  |   | 
  | 48 |  |   | 
  | 49 |  |    public CampaignUserTableBase( | 
  | 50 |  |        Database database, String name, | 
  | 51 |  |        DefinitionSource definitionSource) throws PoemException { | 
  | 52 | 2 |      super(database, name, definitionSource); | 
  | 53 | 2 |    } | 
  | 54 |  |   | 
  | 55 |  |   | 
  | 56 |  |    | 
  | 57 |  |   | 
  | 58 |  |   | 
  | 59 |  |   | 
  | 60 |  |   | 
  | 61 |  |   | 
  | 62 |  |    public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { | 
  | 63 | 4 |      return (BibliomaniaDatabaseTables)getDatabase(); | 
  | 64 |  |    } | 
  | 65 |  |   | 
  | 66 |  |   | 
  | 67 |  |    | 
  | 68 |  |   | 
  | 69 |  |   | 
  | 70 |  |   | 
  | 71 |  |   | 
  | 72 |  |    public void init() throws PoemException { | 
  | 73 | 2 |      super.init(); | 
  | 74 | 2 |      defineColumn(col_id = | 
  | 75 |  |          new Column<Integer>(this, "id", | 
  | 76 |  |                     new TroidPoemType(), | 
  | 77 | 2 |                     DefinitionSource.dsd) {  | 
  | 78 |  |            public Object getCooked(Persistent g) | 
  | 79 |  |                throws AccessPoemException, PoemException { | 
  | 80 | 0 |              return ((CampaignUser)g).getId(); | 
  | 81 |  |            } | 
  | 82 |  |   | 
  | 83 |  |            public void setCooked(Persistent g, Object cooked) | 
  | 84 |  |                throws AccessPoemException, ValidationPoemException { | 
  | 85 | 0 |              ((CampaignUser)g).setId((Integer)cooked); | 
  | 86 | 0 |            } | 
  | 87 |  |   | 
  | 88 |  |            public Field<Integer> asField(Persistent g) { | 
  | 89 | 0 |              return ((CampaignUser)g).getIdField(); | 
  | 90 |  |            } | 
  | 91 |  |   | 
  | 92 |  |            public boolean defaultUserEditable() { | 
  | 93 | 0 |              return false; | 
  | 94 |  |            } | 
  | 95 |  |   | 
  | 96 |  |            public boolean defaultUserCreateable() { | 
  | 97 | 0 |              return false; | 
  | 98 |  |            } | 
  | 99 |  |   | 
  | 100 |  |            public DisplayLevel defaultDisplayLevel() { | 
  | 101 | 0 |              return DisplayLevel.record; | 
  | 102 |  |            } | 
  | 103 |  |   | 
  | 104 |  |            public int defaultDisplayOrder() { | 
  | 105 | 0 |              return 0; | 
  | 106 |  |            } | 
  | 107 |  |   | 
  | 108 |  |            public Object getRaw_unsafe(Persistent g) | 
  | 109 |  |                throws AccessPoemException { | 
  | 110 | 0 |              return ((CampaignUser)g).getId_unsafe(); | 
  | 111 |  |            } | 
  | 112 |  |   | 
  | 113 |  |            public void setRaw_unsafe(Persistent g, Object raw) | 
  | 114 |  |                throws AccessPoemException { | 
  | 115 | 0 |              ((CampaignUser)g).setId_unsafe((Integer)raw); | 
  | 116 | 0 |            } | 
  | 117 |  |   | 
  | 118 |  |            public Object getRaw(Persistent g) | 
  | 119 |  |                throws AccessPoemException { | 
  | 120 | 0 |              return ((CampaignUser)g).getId(); | 
  | 121 |  |            } | 
  | 122 |  |   | 
  | 123 |  |            public void setRaw(Persistent g, Object raw) | 
  | 124 |  |                throws AccessPoemException { | 
  | 125 | 0 |              ((CampaignUser)g).setId((Integer)raw); | 
  | 126 | 0 |            } | 
  | 127 |  |          }); | 
  | 128 |  |   | 
  | 129 | 2 |      defineColumn(col_campaign = | 
  | 130 |  |          new Column<Integer>(this, "campaign", | 
  | 131 |  |                     new ReferencePoemType(getBibliomaniaDatabaseTables(). | 
  | 132 |  |                                               getCampaignTable(), false), | 
  | 133 | 2 |                     DefinitionSource.dsd) {  | 
  | 134 |  |            public Object getCooked(Persistent g) | 
  | 135 |  |                throws AccessPoemException, PoemException { | 
  | 136 | 0 |              return ((CampaignUser)g).getCampaign(); | 
  | 137 |  |            } | 
  | 138 |  |   | 
  | 139 |  |            public void setCooked(Persistent g, Object cooked) | 
  | 140 |  |                throws AccessPoemException, ValidationPoemException { | 
  | 141 | 0 |              ((CampaignUser)g).setCampaign((Campaign)cooked); | 
  | 142 | 0 |            } | 
  | 143 |  |   | 
  | 144 |  |            public Field<Integer> asField(Persistent g) { | 
  | 145 | 0 |              return ((CampaignUser)g).getCampaignField(); | 
  | 146 |  |            } | 
  | 147 |  |   | 
  | 148 |  |            public DisplayLevel defaultDisplayLevel() { | 
  | 149 | 0 |              return DisplayLevel.summary; | 
  | 150 |  |            } | 
  | 151 |  |   | 
  | 152 |  |            public Searchability defaultSearchability() { | 
  | 153 | 0 |              return Searchability.primary; | 
  | 154 |  |            } | 
  | 155 |  |   | 
  | 156 |  |            public String defaultDisplayName() { | 
  | 157 | 0 |              return "Campaign"; | 
  | 158 |  |            } | 
  | 159 |  |   | 
  | 160 |  |            public int defaultDisplayOrder() { | 
  | 161 | 0 |              return 1; | 
  | 162 |  |            } | 
  | 163 |  |   | 
  | 164 |  |            public boolean defaultIndexed() { | 
  | 165 | 0 |              return true; | 
  | 166 |  |            } | 
  | 167 |  |   | 
  | 168 |  |            public Object getRaw_unsafe(Persistent g) | 
  | 169 |  |                throws AccessPoemException { | 
  | 170 | 0 |              return ((CampaignUser)g).getCampaign_unsafe(); | 
  | 171 |  |            } | 
  | 172 |  |   | 
  | 173 |  |            public void setRaw_unsafe(Persistent g, Object raw) | 
  | 174 |  |                throws AccessPoemException { | 
  | 175 | 0 |              ((CampaignUser)g).setCampaign_unsafe((Integer)raw); | 
  | 176 | 0 |            } | 
  | 177 |  |   | 
  | 178 |  |            public Object getRaw(Persistent g) | 
  | 179 |  |                throws AccessPoemException { | 
  | 180 | 0 |              return ((CampaignUser)g).getCampaignTroid(); | 
  | 181 |  |            } | 
  | 182 |  |   | 
  | 183 |  |            public void setRaw(Persistent g, Object raw) | 
  | 184 |  |                throws AccessPoemException { | 
  | 185 | 0 |              ((CampaignUser)g).setCampaignTroid((Integer)raw); | 
  | 186 | 0 |            } | 
  | 187 |  |          }); | 
  | 188 |  |   | 
  | 189 | 2 |      defineColumn(col_user = | 
  | 190 |  |          new Column<Integer>(this, "user", | 
  | 191 |  |                     new ReferencePoemType(getBibliomaniaDatabaseTables(). | 
  | 192 |  |                                               getUserTable(), false), | 
  | 193 | 2 |                     DefinitionSource.dsd) {  | 
  | 194 |  |            public Object getCooked(Persistent g) | 
  | 195 |  |                throws AccessPoemException, PoemException { | 
  | 196 | 0 |              return ((CampaignUser)g).getUser(); | 
  | 197 |  |            } | 
  | 198 |  |   | 
  | 199 |  |            public void setCooked(Persistent g, Object cooked) | 
  | 200 |  |                throws AccessPoemException, ValidationPoemException { | 
  | 201 | 0 |              ((CampaignUser)g).setUser((User)cooked); | 
  | 202 | 0 |            } | 
  | 203 |  |   | 
  | 204 |  |            public Field<Integer> asField(Persistent g) { | 
  | 205 | 0 |              return ((CampaignUser)g).getUserField(); | 
  | 206 |  |            } | 
  | 207 |  |   | 
  | 208 |  |            public DisplayLevel defaultDisplayLevel() { | 
  | 209 | 0 |              return DisplayLevel.summary; | 
  | 210 |  |            } | 
  | 211 |  |   | 
  | 212 |  |            public Searchability defaultSearchability() { | 
  | 213 | 0 |              return Searchability.yes; | 
  | 214 |  |            } | 
  | 215 |  |   | 
  | 216 |  |            public String defaultDisplayName() { | 
  | 217 | 0 |              return "User"; | 
  | 218 |  |            } | 
  | 219 |  |   | 
  | 220 |  |            public int defaultDisplayOrder() { | 
  | 221 | 0 |              return 2; | 
  | 222 |  |            } | 
  | 223 |  |   | 
  | 224 |  |            public boolean defaultIndexed() { | 
  | 225 | 0 |              return true; | 
  | 226 |  |            } | 
  | 227 |  |   | 
  | 228 |  |            public String defaultRenderinfo() { | 
  | 229 | 0 |              return "SelectionWindow"; | 
  | 230 |  |            } | 
  | 231 |  |   | 
  | 232 |  |            public Object getRaw_unsafe(Persistent g) | 
  | 233 |  |                throws AccessPoemException { | 
  | 234 | 0 |              return ((CampaignUser)g).getUser_unsafe(); | 
  | 235 |  |            } | 
  | 236 |  |   | 
  | 237 |  |            public void setRaw_unsafe(Persistent g, Object raw) | 
  | 238 |  |                throws AccessPoemException { | 
  | 239 | 0 |              ((CampaignUser)g).setUser_unsafe((Integer)raw); | 
  | 240 | 0 |            } | 
  | 241 |  |   | 
  | 242 |  |            public Object getRaw(Persistent g) | 
  | 243 |  |                throws AccessPoemException { | 
  | 244 | 0 |              return ((CampaignUser)g).getUserTroid(); | 
  | 245 |  |            } | 
  | 246 |  |   | 
  | 247 |  |            public void setRaw(Persistent g, Object raw) | 
  | 248 |  |                throws AccessPoemException { | 
  | 249 | 0 |              ((CampaignUser)g).setUserTroid((Integer)raw); | 
  | 250 | 0 |            } | 
  | 251 |  |          }); | 
  | 252 | 2 |    } | 
  | 253 |  |   | 
  | 254 |  |   | 
  | 255 |  |    | 
  | 256 |  |   | 
  | 257 |  |   | 
  | 258 |  |   | 
  | 259 |  |   | 
  | 260 |  |   | 
  | 261 |  |   | 
  | 262 |  |    public final Column<Integer> getIdColumn() { | 
  | 263 | 0 |      return col_id; | 
  | 264 |  |    } | 
  | 265 |  |   | 
  | 266 |  |   | 
  | 267 |  |    | 
  | 268 |  |   | 
  | 269 |  |   | 
  | 270 |  |   | 
  | 271 |  |   | 
  | 272 |  |   | 
  | 273 |  |   | 
  | 274 |  |    public final Column<Integer> getCampaignColumn() { | 
  | 275 | 0 |      return col_campaign; | 
  | 276 |  |    } | 
  | 277 |  |   | 
  | 278 |  |   | 
  | 279 |  |    | 
  | 280 |  |   | 
  | 281 |  |   | 
  | 282 |  |   | 
  | 283 |  |   | 
  | 284 |  |   | 
  | 285 |  |   | 
  | 286 |  |    public final Column<Integer> getUserColumn() { | 
  | 287 | 0 |      return col_user; | 
  | 288 |  |    } | 
  | 289 |  |   | 
  | 290 |  |   | 
  | 291 |  |    | 
  | 292 |  |   | 
  | 293 |  |   | 
  | 294 |  |   | 
  | 295 |  |   | 
  | 296 |  |   | 
  | 297 |  |   | 
  | 298 |  |    public CampaignUser getCampaignUserObject(Integer troid) { | 
  | 299 | 0 |      return (CampaignUser)getObject(troid); | 
  | 300 |  |    } | 
  | 301 |  |   | 
  | 302 |  |   | 
  | 303 |  |    | 
  | 304 |  |   | 
  | 305 |  |   | 
  | 306 |  |   | 
  | 307 |  |   | 
  | 308 |  |   | 
  | 309 |  |   | 
  | 310 |  |    public CampaignUser getCampaignUserObject(int troid) { | 
  | 311 | 0 |      return (CampaignUser)getObject(troid); | 
  | 312 |  |    } | 
  | 313 |  |   | 
  | 314 |  |    protected JdbcPersistent _newPersistent() { | 
  | 315 | 0 |      return new CampaignUser(); | 
  | 316 |  |    } | 
  | 317 |  |    public String defaultDescription() { | 
  | 318 | 0 |      return "A user in a Campaign"; | 
  | 319 |  |    } | 
  | 320 |  |   | 
  | 321 |  |    public boolean defaultRememberAllTroids() { | 
  | 322 | 0 |      return true; | 
  | 323 |  |    } | 
  | 324 |  |   | 
  | 325 |  |    public String defaultCategory() { | 
  | 326 | 0 |      return "User"; | 
  | 327 |  |    } | 
  | 328 |  |   | 
  | 329 |  |    public int defaultDisplayOrder() { | 
  | 330 | 0 |      return 2110; | 
  | 331 |  |    } | 
  | 332 |  |  } | 
  | 333 |  |   |