org.melati.poem.prepro
Class TableNamingInfo

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

public class TableNamingInfo
extends Object

A store for Table Name information extracted from the DSD.


Field Summary
 boolean hidden
          Does this Table have the same name as another table "lower down" in our hierarchy.
 boolean hidesOther
          Does this Table have the same name as another table "higher up" in our hierarchy (that is a table already dealt with by DSD).
 String packageName
          This package eg org.melati.example.contacts .
 TableNamingInfo superclass
          The TableNamingInfo of this Table's superclass (or null if extends Persistent or Table).
 String tableFQName
          The fully qualified name of the table (e.g.
 String tableShortName
          The last part of the FQName of the table (e.g.
 
Constructor Summary
TableNamingInfo(String packageNameIn, String projectNameIn, String name)
          Constructor.
 
Method Summary
protected  TableNamingInfo getRootSameNamedSuperclass()
          Find the top-most superclass of this table which has the same (short) name
 String mainClassFQName()
           
 String mainClassRootReturnClass()
          We need to make sure that this is the same class as that returned by the root superclass of the same name because you cannot override a function and change its return type.
 String mainClassShortName()
           
 String mainClassUnambiguous()
           
 String superclassMainFQName()
          Calculate the full type for the superclass of the Persistent.
 String superclassMainShortName()
          Calculate the name of the superclass of the Persistent.
 String superclassMainUnambiguous()
          Calculate the type for objects in this Table.
 String superclassTableFQName()
          Calculate the full type for the superclass of this Table.
 String superclassTableShortName()
          Calculate the type for the superclass of this Table.
 String superclassTableUnambiguous()
          Calculate the type for this Table.
 String tableMainClassRootReturnClass()
          Find the return type we should use when calling getXxxxObject().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packageName

public String packageName
This package eg org.melati.example.contacts .


tableFQName

public String tableFQName
The fully qualified name of the table (e.g. `org.melati.poem.User')


tableShortName

public String tableShortName
The last part of the FQName of the table (e.g. `User')


superclass

public TableNamingInfo superclass
The TableNamingInfo of this Table's superclass (or null if extends Persistent or Table).


hidesOther

public boolean hidesOther
Does this Table have the same name as another table "higher up" in our hierarchy (that is a table already dealt with by DSD). If so, we must import the tableFQName before the DSD's package and before melati in our java source. For example org.paneris.melati.boards.model.UserTable hides org.melati.poem.UserTable and so has hidesOther true.


hidden

public boolean hidden
Does this Table have the same name as another table "lower down" in our hierarchy. If so, we must use the tableFQName as the return type in the DatabaseBase source file, and any tables with ReferenceTypes to this table. For example org.melati.poem.UserTable is hidden by org.paneris.melati.boards.model.UserTable and so has hidden true.

Constructor Detail

TableNamingInfo

public TableNamingInfo(String packageNameIn,
                       String projectNameIn,
                       String name)
Constructor.

Parameters:
packageNameIn - the fully qualified java name of this package
projectNameIn - the name of this project
name - the name of this table
Method Detail

superclassMainUnambiguous

public String superclassMainUnambiguous()
Calculate the type for objects in this Table.

Returns:
the name for the Persistent class

superclassMainFQName

public String superclassMainFQName()
Calculate the full type for the superclass of the Persistent.

Returns:
the fully qualified name for the superclass

superclassMainShortName

public String superclassMainShortName()
Calculate the name of the superclass of the Persistent.

Returns:
the short name for the superclass

superclassTableUnambiguous

public String superclassTableUnambiguous()
Calculate the type for this Table.

Returns:
the unambiguous name

superclassTableFQName

public String superclassTableFQName()
Calculate the full type for the superclass of this Table.

Returns:
the superclass fully qualified name

superclassTableShortName

public String superclassTableShortName()
Calculate the type for the superclass of this Table.

Returns:
the superclass short name

mainClassFQName

public String mainClassFQName()
Returns:
the fully qualified name of the main class for this table

mainClassShortName

public String mainClassShortName()
Returns:
the name of the main class for this table

mainClassUnambiguous

public String mainClassUnambiguous()
Returns:
a name for this class which will properly refer to this table given the import lines we put in all our generated flies

mainClassRootReturnClass

public String mainClassRootReturnClass()
We need to make sure that this is the same class as that returned by the root superclass of the same name because you cannot override a function and change its return type.

Returns:
type we should use when calling getXxxxTable().

tableMainClassRootReturnClass

public String tableMainClassRootReturnClass()
Find the return type we should use when calling getXxxxObject(). We need to make sure that this is the same class as that returned by the root superclass of the same name because you cannot override a function and change its return type.

NB if the superclass is abstract then we

Returns:
the root return class

getRootSameNamedSuperclass

protected TableNamingInfo getRootSameNamedSuperclass()
Find the top-most superclass of this table which has the same (short) name



Copyright © 2000-2010 PanEris. All Rights Reserved.