org.jaffa.tools.domainmeta.common
Class TableBean

java.lang.Object
  extended byorg.jaffa.tools.domainmeta.common.TableBean
All Implemented Interfaces:
Serializable

public class TableBean
extends Object
implements Serializable

Java Bean to store information about a domain object

Author:
PaulE
See Also:
Serialized Form

Constructor Summary
TableBean()
          Creates new TableBean
 
Method Summary
 void addRelationship(TableBean table, boolean cardinalityMany)
          Add a relationship from this table to another one.
static String formatName(String name)
          Format a field / table name so it complies with Jaffa.
 String getDescription()
          Getter for property description.
 String getDomainName()
          Getter for property domainName.
 String getDomainPackage()
          Getter for property domainPackage.
 HashMap getFields()
          Getter for property fields.
 String getId()
          Getter for property id.
 String getLabel()
          Getter for property label.
 ArrayList getRelationships()
          Getter for property relationships.
 String getTableName()
          Getter for property tableName.
 void setDescription(String description)
          Setter for property description.
 void setDomainName(String domainName)
          Setter for property domainName.
 void setDomainPackage(String domainPackage)
          Setter for property domainPackage.
 void setFields(LinkedHashMap fields)
          Setter for property fields.
 void setId(String id)
          Setter for property id.
 void setLabel(String label)
          Setter for property label.
 void setTableName(String tableName)
          Setter for property tableName.
 void write(PrintWriter out, String mappingPackage, String patternTemplate)
          Write out an XML verion of the bean, including all the fields beans in this table bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableBean

public TableBean()
Creates new TableBean

Method Detail

write

public void write(PrintWriter out,
                  String mappingPackage,
                  String patternTemplate)
Write out an XML verion of the bean, including all the fields beans in this table bean.

Parameters:
mappingPackage - mapping packge for this table to use
patternTemplate - pattern template this this is based on
out - XMl representation as a string

getId

public String getId()
Getter for property id.

Returns:
Value of property id.

setId

public void setId(String id)
Setter for property id.

Parameters:
id - New value of property id.

getTableName

public String getTableName()
Getter for property tableName.

Returns:
Value of property tableName.

setTableName

public void setTableName(String tableName)
Setter for property tableName.

Parameters:
tableName - New value of property tableName.

getFields

public HashMap getFields()
Getter for property fields.

Returns:
Value of property fields.

setFields

public void setFields(LinkedHashMap fields)
Setter for property fields.

Parameters:
fields - New value of property fields.

getDomainName

public String getDomainName()
Getter for property domainName.

Returns:
Value of property domainName.

setDomainName

public void setDomainName(String domainName)
Setter for property domainName.

Parameters:
domainName - New value of property domainName.

getDomainPackage

public String getDomainPackage()
Getter for property domainPackage.

Returns:
Value of property domainPackage.

setDomainPackage

public void setDomainPackage(String domainPackage)
Setter for property domainPackage.

Parameters:
domainPackage - New value of property domainPackage.

getRelationships

public ArrayList getRelationships()
Getter for property relationships.

Returns:
Value of property relationships.

addRelationship

public void addRelationship(TableBean table,
                            boolean cardinalityMany)
Add a relationship from this table to another one. It assumes that the key of this table are the same fields names that relate the two tables

Parameters:
table - table this one is related to
cardinalityMany - true if this is a one to many table, false if its one-to-one

formatName

public static String formatName(String name)
Format a field / table name so it complies with Jaffa. Typically names have no spaces and each word is caplitalized.

Parameters:
name - original database name
Returns:
Jaffa compatible name

getLabel

public String getLabel()
Getter for property label.

Returns:
Value of property label.

setLabel

public void setLabel(String label)
Setter for property label.

Parameters:
label - New value of property label.

getDescription

public String getDescription()
Getter for property description.

Returns:
Value of property description.

setDescription

public void setDescription(String description)
Setter for property description.

Parameters:
description - New value of property description.


Copyright © 2002-2004 JAFFA Project.