Coverage Report - org.paneris.bibliomania.BoardTypeTable
 
Classes in this File Line Coverage Branch Coverage Complexity
BoardTypeTable
10%
2/20
N/A
1
 
 1  
 package org.paneris.bibliomania;
 2  
 
 3  
 
 4  
 import java.sql.ResultSet;
 5  
 
 6  
 import org.paneris.bibliomania.generated.BoardTypeTableBase;
 7  
 import org.melati.poem.DefinitionSource;
 8  
 import org.melati.poem.Database;
 9  
 import org.melati.poem.PoemException;
 10  
 
 11  
 /**
 12  
  * Melati POEM generated, programmer modifiable stub 
 13  
  * for a <code>BoardTypeTable</code> object.
 14  
  *
 15  
  * 
 16  
  * <table> 
 17  
  * <tr><th colspan='3'>
 18  
  * Field summary for SQL table <code>BoardType</code>
 19  
  * </th></tr>
 20  
  * <tr><th>Name</th><th>Type</th><th>Description</th></tr>
 21  
  * </table> 
 22  
  * 
 23  
  * see  org.melati.poem.prepro.TableDef#generateTableJava 
 24  
  */
 25  
 public class BoardTypeTable<T extends BoardType> extends BoardTypeTableBase<BoardType> {
 26  
 
 27  
  /**
 28  
   * Constructor.
 29  
   * 
 30  
   * see org.melati.poem.prepro.TableDef#generateTableJava 
 31  
   * @param database          the POEM database we are using
 32  
   * @param name              the name of this <code>Table</code>
 33  
   * @param definitionSource  which definition is being used
 34  
   * @throws PoemException    if anything goes wrong
 35  
   */
 36  
   public BoardTypeTable(
 37  
       Database database, String name,
 38  
       DefinitionSource definitionSource) throws PoemException {
 39  2
     super(database, name, definitionSource);
 40  2
   }
 41  
 
 42  
   // programmer's domain-specific code here
 43  
   
 44  
   protected BoardType general;
 45  
   protected BoardType sectionGroup;
 46  
   protected BoardType section;
 47  
   protected BoardType author;
 48  
   protected BoardType book;
 49  
   protected BoardType chapter;
 50  
 
 51  
 
 52  
 
 53  
 
 54  
   public synchronized void unifyWithDB(ResultSet colDescs)
 55  
       throws PoemException {
 56  0
     super.unifyWithDB(colDescs,"id");
 57  0
      general =  ensure("General","Top level boards");
 58  0
      sectionGroup = ensure("SectionGroup","SectionGroup messageboard");
 59  0
      section = ensure("Section","Section messageboard");
 60  0
      author = ensure("Author","Author messageboard");
 61  0
      book = ensure("Book","Book messageboard");
 62  0
      chapter = ensure("Chapter","Chapter messageboard");
 63  0
   }
 64  
 
 65  
 
 66  
   public BoardType ensure(String type, String description) {
 67  0
     BoardType t = (BoardType)newPersistent();
 68  0
     t.setType(type);
 69  0
     t.setDescription(description);
 70  
     
 71  0
     return (BoardType)getTypeColumn().ensure(t);
 72  
   }
 73  
 
 74  
 
 75  
   public BoardType general() {
 76  0
     return general;
 77  
   }
 78  
 
 79  
   public BoardType sectionGroup() {
 80  0
     return sectionGroup;
 81  
   }
 82  
 
 83  
   public BoardType section() {
 84  0
     return section;
 85  
   }
 86  
 
 87  
   public BoardType author() {
 88  0
     return author;
 89  
   }
 90  
 
 91  
   public BoardType book() {
 92  0
     return book;
 93  
   }
 94  
 
 95  
   public BoardType chapter() {
 96  0
     return chapter;
 97  
   }
 98  
 
 99  
   
 100  
 }
 101