org.melati.poem.prepro
Class TableDef

Package class diagram package TableDef
java.lang.Object
  extended by org.melati.poem.prepro.TableDef

public class TableDef
extends Object

A Table Definition holding information from a DSD. The SQL table naming convention is enforced here: the name given in the DSD is forced to lowercase. This could be changed to enable mixed case names in jdbc names by simply not forcing to lowercase, but the JavaName has first letter capitalised. The way around this is to have a separate jdbc name, but this would be a lot of redundancy for a small use case. The use case is actually broken: MySQL allows significant table name case, but only on operating systems where file name case is significant, and the manual advises against. The solution is to add the following to /etc/mysqld/my.cnf [mysqld] lower_case_table_names=1


Constructor Summary
TableDef(DSD dsd, StreamTokenizer tokens, int displayOrder, boolean isAbstract, TableNamingStore nameStore)
          Constructor.
 
Method Summary
 void generateJava()
          Generate the 4 files.
 void generatePersistentBaseJava(Writer w)
           
 void generatePersistentJava(Writer w)
           
 void generateTableAccessorDefnJava(Writer w)
           
 void generateTableAccessorJava(Writer w)
           
 void generateTableBaseJava(Writer w)
           
 void generateTableDeclJava(Writer w)
           
 void generateTableDefnJava(Writer w)
           
 void generateTableJava(Writer w)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDef

public TableDef(DSD dsd,
                StreamTokenizer tokens,
                int displayOrder,
                boolean isAbstract,
                TableNamingStore nameStore)
         throws org.melati.poem.prepro.ParsingDSDException,
                IOException,
                org.melati.poem.prepro.IllegalityException
Constructor.

Parameters:
dsd - the DSD this is a member of
tokens - a stream of tokens
displayOrder - the ordering within the DSD
isAbstract - whether this is an abstract table
nameStore - where to put our names
Throws:
ParsingDSDException - if an unexpected token is encountered
IllegalityException - if a semantic incoherence is detected
IOException - if a problem with the file system is encountered
Method Detail

generateTableDeclJava

public void generateTableDeclJava(Writer w)
                           throws IOException
Parameters:
w - DatabaseBase
Throws:
IOException - if a problem with the file system is encountered

generateTableDefnJava

public void generateTableDefnJava(Writer w)
                           throws IOException
Parameters:
w - DatabaseBase
Throws:
IOException - if a problem with the file system is encountered

generateTableAccessorJava

public void generateTableAccessorJava(Writer w)
                               throws IOException
Parameters:
w - DatabaseBase
Throws:
IOException - if a problem with the file system is encountered

generateTableAccessorDefnJava

public void generateTableAccessorDefnJava(Writer w)
                                   throws IOException
Parameters:
w - DatabaseTablesBase
Throws:
IOException - if a problem with the file system is encountered

generatePersistentBaseJava

public void generatePersistentBaseJava(Writer w)
                                throws IOException
Parameters:
w - Persistent Base writer
Throws:
IOException - if a problem with the file system is encountered

generatePersistentJava

public void generatePersistentJava(Writer w)
                            throws IOException
Parameters:
w - Persistent writer
Throws:
IOException - if a problem with the file system is encountered

generateTableBaseJava

public void generateTableBaseJava(Writer w)
                           throws IOException
Parameters:
w - TableBase
Throws:
IOException - if a problem with the file system is encountered

generateTableJava

public void generateTableJava(Writer w)
                       throws IOException
Parameters:
w - Table
Throws:
IOException - if a problem with the file system is encountered

generateJava

public void generateJava()
                  throws IOException,
                         org.melati.poem.prepro.IllegalityException
Generate the 4 files.

Throws:
IOException - if a problem with the file system is encountered
IllegalityException - if a semantic incoherence is detected


Copyright © 2000-2010 PanEris. All Rights Reserved.