org.objectweb.jorm.metainfo.api.rdb
Interface RDBClassMapping

All Superinterfaces:
ClassMapping, MetaObject, java.io.Serializable
All Known Implementing Classes:
BasicRDBClassMapping, BasicRDBClassMapping

public interface RDBClassMapping
extends ClassMapping

RDBClassMapping defines methods to describe how the a class is mapped into a relational database system.

Author:
X. Spengler

Method Summary
 void addPrimaryKey(java.lang.String pk)
          Adds a primary key to the list of existing primary key for the current table.
 java.lang.String getTableName()
          Allows to know the name of the table.
 boolean isNotNull()
          Allows to know if the table can be null or not.
 java.util.Iterator iteratePrimaryKey()
          Returns an iterator on all the primary keys from the current table.
 void setNotNull(boolean notnull)
          Defines if the current table can be null or not.
 void setTableName(java.lang.String tableName)
          Sets the name of the relational table
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.ClassMapping
getMapperName, getMappingName
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject
getParent, setParent
 

Method Detail

getTableName

public java.lang.String getTableName()
Allows to know the name of the table.
Returns:
the name of the table for the current relational class mapping

setTableName

public void setTableName(java.lang.String tableName)
Sets the name of the relational table
Parameters:
tableName - the name of the table

setNotNull

public void setNotNull(boolean notnull)
Defines if the current table can be null or not.
Parameters:
notnull - true, the table can not be null, else false, the table can be null.

isNotNull

public boolean isNotNull()
Allows to know if the table can be null or not.
Returns:
true, the table can not be null, else false, the table can be null.

addPrimaryKey

public void addPrimaryKey(java.lang.String pk)
Adds a primary key to the list of existing primary key for the current table.
Parameters:
pk - the name of the new primary key

iteratePrimaryKey

public java.util.Iterator iteratePrimaryKey()
Returns an iterator on all the primary keys from the current table. This iterator contains String objects.
Returns:
an iterator on primary keys, or an empty iterator if no key exists