thinkmap.datasource.relational
Class EntityModel

java.lang.Object
  extended by thinkmap.datasource.relational.EntityModel
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EdgeEntityModel, NodeEntityModel

public abstract class EntityModel
extends Object
implements Serializable

Abstract superclass for an object that represents an Entity in relational terms. RelationalDataSources use concrete instances of this representing nodes and edges.

Version:
$Revision: 1.14 $
See Also:
NodeEntityModel, EdgeEntityModel, Serialized Form

Field Summary
protected  Byte cacheFlag
           
protected  List<ColumnModel<?>> models
           
 
Constructor Summary
protected EntityModel()
           
 
Method Summary
 void addColumn(ColumnModel<?> cm)
           
abstract
<T> ColumnModel<T>
createColumn()
           
 ColumnModel<?> getColumnModel(String name)
           
 ColumnModel<?>[] getColumnModels()
          Get the array of ColumnModels that describe this EntityModel's fields.
 List<ColumnModel<?>> getColumns()
           
 int getMaxResults()
          Get the maximum number of entities that should be returned.
 String getName()
          Get the name of this EntityModel.
 String getParent()
          Get the parent entity type of this entity.
 String getTable()
          Get the name of the table represented by this EntityModel.
 int indexOf(ColumnModel<?> columnModel)
          Find the index of a particular ColumnModel in this EntityModel's ColumnModel array.
 void outputMetadata(IEntityHandler callback)
           
 boolean parseEntityId(String searchString, IEntityHandler callback)
           
 void setMaxResults(int maxResults)
          Set the maximum number of entities that should be returned.
 void setName(String s)
          Set the name of this EntityModel.
 void setParent(String parent)
          Set the parent entity type of this entity.
 void setTable(String s)
          Set the name of the table represented by this EntityModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheFlag

protected Byte cacheFlag

models

protected List<ColumnModel<?>> models
Constructor Detail

EntityModel

protected EntityModel()
Method Detail

getName

public String getName()
Get the name of this EntityModel. This is the Entity's type.

Returns:
name

setName

public void setName(String s)
Set the name of this EntityModel. This is the Entity's type.

Parameters:
s - name

getTable

public String getTable()
Get the name of the table represented by this EntityModel.

Returns:
table name

setTable

public void setTable(String s)
Set the name of the table represented by this EntityModel.

Parameters:
s - table name

getColumnModels

public ColumnModel<?>[] getColumnModels()
Get the array of ColumnModels that describe this EntityModel's fields.

Returns:
ColumnModel array

createColumn

public abstract <T> ColumnModel<T> createColumn()

addColumn

public void addColumn(ColumnModel<?> cm)

getColumns

public List<ColumnModel<?>> getColumns()

getColumnModel

public ColumnModel<?> getColumnModel(String name)

indexOf

public int indexOf(ColumnModel<?> columnModel)
Find the index of a particular ColumnModel in this EntityModel's ColumnModel array.

Parameters:
columnModel - ColumnModel to look for
Returns:
index, or -1 if not found

setParent

public void setParent(String parent)
Set the parent entity type of this entity.

Parameters:
parent - parent entity type

getParent

public String getParent()
Get the parent entity type of this entity.

Returns:
parent entity type

setMaxResults

public void setMaxResults(int maxResults)
Set the maximum number of entities that should be returned.

Parameters:
maxResults - max results

getMaxResults

public int getMaxResults()
Get the maximum number of entities that should be returned.

Returns:
max results

outputMetadata

public void outputMetadata(IEntityHandler callback)

parseEntityId

public boolean parseEntityId(String searchString,
                             IEntityHandler callback)


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.