View Javadoc

1   // Do not edit this file!  It was generated by Melati POEM's DSD preprocessor.
2   
3   package org.paneris.bibliomania.generated;
4   
5   
6   import java.util.Collections;
7   import java.util.Enumeration;
8   import java.util.List;
9   import org.melati.poem.CachedSelection;
10  import org.melati.poem.util.EmptyEnumeration;
11  import org.paneris.bibliomania.BibliomaniaDatabaseTables;
12  // import org.paneris.bibliomania.BoardType;
13  // import org.paneris.bibliomania.BoardTypeTable;
14  import org.paneris.melati.boards.model.Board;
15  // import org.paneris.melati.boards.model.BoardType;
16  
17  
18  /**
19   * Melati POEM generated abstract base class for a <code>Persistent</code> 
20   * <code>BoardType</code> Object.
21   *
22   * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
23   */
24  public abstract class BoardTypeBase extends org.paneris.melati.boards.model.BoardType {
25  
26  
27   /**
28    * Retrieves the Database object.
29    * 
30    * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
31    * @return the database
32    */
33    public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
34      return (BibliomaniaDatabaseTables)getDatabase();
35    }
36  
37  
38   /**
39    * Retrieves the  <code>BoardTypeTable</code> table 
40    * which this <code>Persistent</code> is from.
41    * 
42    * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
43    * @return the org.paneris.melati.boards.model.BoardTypeTable
44    */
45    @SuppressWarnings("unchecked")
46    public org.paneris.melati.boards.model.BoardTypeTable<org.paneris.melati.boards.model.BoardType> getBoardTypeTable() {
47      return (org.paneris.melati.boards.model.BoardTypeTable<org.paneris.melati.boards.model.BoardType>)getTable();
48    }
49  
50    // There are no Fields in this table, only in its ancestors 
51  
52    private CachedSelection<Board> typeBoards = null;
53    /** References to this BoardType in the Board table via its type field.*/
54    @SuppressWarnings("unchecked")
55    public Enumeration<Board> getTypeBoards() {
56      if (getTroid() == null)
57        return new EmptyEnumeration<Board>();
58      else {
59        if (typeBoards == null)
60          typeBoards =
61            getBibliomaniaDatabaseTables().getBoardTable().getTypeColumn().cachedSelectionWhereEq(getTroid());
62        return typeBoards.objects();
63      }
64    }
65  
66  
67    /** References to this BoardType in the Board table via its type field, as a List.*/
68    public List<Board> getTypeBoardList() {
69      return Collections.list(getTypeBoards());
70    }
71  
72  
73  
74  }
75