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.Board;
13  // import org.paneris.bibliomania.BoardTable;
14  // import org.paneris.melati.boards.model.Board;
15  import org.paneris.melati.boards.model.Message;
16  import org.paneris.melati.boards.model.Subscription;
17  
18  
19  /**
20   * Melati POEM generated abstract base class for a <code>Persistent</code> 
21   * <code>Board</code> Object.
22   *
23   * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
24   */
25  public abstract class BoardBase extends org.paneris.melati.boards.model.Board {
26  
27  
28   /**
29    * Retrieves the Database object.
30    * 
31    * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
32    * @return the database
33    */
34    public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
35      return (BibliomaniaDatabaseTables)getDatabase();
36    }
37  
38  
39   /**
40    * Retrieves the  <code>BoardTable</code> table 
41    * which this <code>Persistent</code> is from.
42    * 
43    * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
44    * @return the org.paneris.melati.boards.model.BoardTable
45    */
46    @SuppressWarnings("unchecked")
47    public org.paneris.melati.boards.model.BoardTable<org.paneris.melati.boards.model.Board> getBoardTable() {
48      return (org.paneris.melati.boards.model.BoardTable<org.paneris.melati.boards.model.Board>)getTable();
49    }
50  
51    // There are no Fields in this table, only in its ancestors 
52  
53    private CachedSelection<Subscription> boardSubscriptions = null;
54    /** References to this Board in the Subscription table via its board field.*/
55    @SuppressWarnings("unchecked")
56    public Enumeration<Subscription> getBoardSubscriptions() {
57      if (getTroid() == null)
58        return new EmptyEnumeration<Subscription>();
59      else {
60        if (boardSubscriptions == null)
61          boardSubscriptions =
62            getBibliomaniaDatabaseTables().getSubscriptionTable().getBoardColumn().cachedSelectionWhereEq(getTroid());
63        return boardSubscriptions.objects();
64      }
65    }
66  
67  
68    /** References to this Board in the Subscription table via its board field, as a List.*/
69    public List<Subscription> getBoardSubscriptionList() {
70      return Collections.list(getBoardSubscriptions());
71    }
72  
73  
74  
75    private CachedSelection<Message> boardMessages = null;
76    /** References to this Board in the Message table via its board field.*/
77    @SuppressWarnings("unchecked")
78    public Enumeration<Message> getBoardMessages() {
79      if (getTroid() == null)
80        return new EmptyEnumeration<Message>();
81      else {
82        if (boardMessages == null)
83          boardMessages =
84            getBibliomaniaDatabaseTables().getMessageTable().getBoardColumn().cachedSelectionWhereEq(getTroid());
85        return boardMessages.objects();
86      }
87    }
88  
89  
90    /** References to this Board in the Message table via its board field, as a List.*/
91    public List<Message> getBoardMessageList() {
92      return Collections.list(getBoardMessages());
93    }
94  
95  
96  
97  }
98