org.objectweb.jorm.metainfo.rdb
Class BasicRDBClassMapping
java.lang.Object
|
+--org.objectweb.jorm.metainfo.lib.BasicClassMapping
|
+--org.objectweb.jorm.metainfo.rdb.BasicRDBClassMapping
- All Implemented Interfaces:
- ClassMapping, Loggable, MetaObject, RDBClassMapping, java.io.Serializable
- public class BasicRDBClassMapping
- extends BasicClassMapping
- implements RDBClassMapping, java.io.Serializable
BasicRDBClassMapping defines methods to describe how the a class is mapped
into a relational database system.
- Author:
- X. Spengler
- See Also:
- Serialized Form
|
Constructor Summary |
BasicRDBClassMapping(java.lang.String mapperName,
java.lang.String mappingName,
MetaObject parent)
Builds a new BasicRDBClassMapping. |
|
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 class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicRDBClassMapping
public BasicRDBClassMapping(java.lang.String mapperName,
java.lang.String mappingName,
MetaObject parent)
- Builds a new BasicRDBClassMapping.
This object is defined by the name of the mapper, the name of the mapping
class and its parent.
- Parameters:
mapperName - the name of the mapper.mappingName - the name of the class mapping class.parent - the parent of the current object.
getTableName
public java.lang.String getTableName()
- Allows to know the name of the table.
- Specified by:
getTableName in interface RDBClassMapping
- 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
- Specified by:
setTableName in interface RDBClassMapping
- Parameters:
tableName - the name of the table
setNotNull
public void setNotNull(boolean notnull)
- Defines if the current table can be null or not.
- Specified by:
setNotNull in interface RDBClassMapping
- 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.
- Specified by:
isNotNull in interface RDBClassMapping
- 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.
- Specified by:
addPrimaryKey in interface RDBClassMapping
- 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.
- Specified by:
iteratePrimaryKey in interface RDBClassMapping
- Returns:
- an iterator on primary keys, or an empty iterator if no key
exists