thinkmap.datasource.relational
Class ColumnModel<T>

java.lang.Object
  extended by thinkmap.datasource.relational.ColumnModel<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EdgeColumnModel, NodeColumnModel

public abstract class ColumnModel<T>
extends Object
implements Serializable

ColumnModel describes columns in a relational model. It is used to determine how data fields are transformed into properties, and/or to define fields for use in creating relationships between tables.

Version:
$Revision: 1.6 $
See Also:
Serialized Form

Field Summary
protected  EntityModel entityModel
           
 
Constructor Summary
ColumnModel(EntityModel model)
           
 
Method Summary
 T convert(String ob)
          Convert an object into an object of the specified type.
 String getAlias()
          Gets the name of the property that this column will produce, or null, if the name is the same as the colum name.
 EntityModel getEntityModel()
           
 String getName()
          Get the name of this ColumnModel.
 Class<T> getType()
          Get the type of data this ColumnModel represents.
 boolean isKey()
          Determine if the column represented by this NodeColumnModel is an ID key.
 boolean isProperty()
          Determine if this column should be used as a property in the datasource.
 void setAlias(String alias)
          Sets the name of the property that this column will produce.
 void setKey(boolean b)
          Set whether or not the column represented by this column is an ID key.
 void setName(String s)
          Set the name of this column
 void setProperty(boolean b)
          Set whether or not this column should be used as a property in the datasource.
 void setType(Class<T> c)
          Set the type of data this column represents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityModel

protected EntityModel entityModel
Constructor Detail

ColumnModel

public ColumnModel(EntityModel model)
Method Detail

getType

public Class<T> getType()
Get the type of data this ColumnModel represents.

Returns:
type

setType

public void setType(Class<T> c)
Set the type of data this column represents.

Parameters:
c - type

getName

public String getName()
Get the name of this ColumnModel.

Returns:
name

setName

public void setName(String s)
Set the name of this column

Parameters:
s - name

isProperty

public boolean isProperty()
Determine if this column should be used as a property in the datasource.

Returns:
true if this column represents a property

setProperty

public void setProperty(boolean b)
Set whether or not this column should be used as a property in the datasource.

Parameters:
b - true if this column represents a property

isKey

public boolean isKey()
Determine if the column represented by this NodeColumnModel is an ID key.

Returns:
true if this column is an ID key

setKey

public void setKey(boolean b)
Set whether or not the column represented by this column is an ID key.

Parameters:
b - true if this column should be an ID key

getAlias

public String getAlias()
Gets the name of the property that this column will produce, or null, if the name is the same as the colum name.

Returns:
the name of the property that this column will produce.

setAlias

public void setAlias(String alias)
Sets the name of the property that this column will produce. If none is specified, then the name will be the same as the column name.

Parameters:
alias - the name of the property that this column will produce.

getEntityModel

public EntityModel getEntityModel()

convert

public T convert(String ob)
Convert an object into an object of the specified type.

Parameters:
ob - object to convert
c - desired type
Returns:
converted object


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.