FileDocCategorySizeDatePackage
RelationalDescriptor.javaAPI DocGlassfish v2 API5957Tue May 22 16:54:16 BST 2007oracle.toplink.essentials.descriptors

RelationalDescriptor

public class RelationalDescriptor extends ClassDescriptor

Purpose: TopLink has been designed to take advantage of the similarities between relational databases and objects while accommodating for their differences, providing an object oriented wrapper for relational databases. This is accomplished through the use of Descriptors. A descriptor is a pure specification class with all its behaviour deputized to DescriptorEventManager, DescriptorQueryManager and ObjectBuilder. Look at the following variables for the list of specification on the descriptor.

A Descriptor is a set of mappings that describe how an objects's data is to be represented in a relational database. It contains mappings from the class instance variables to the table's fields, as well as the transformation routines necessary for storing and retrieving attributes. As such the descriptor acts as the link between the Java object and its database representaiton.

Every descripor is initialized with the following information:

  • The Java class its describes, and the corresponding table(s) for storing instances of the class.
  • The primary key of the table.
  • A list of query keys for field names.
  • A description of the objects's attributes and relationships. This information is stored in mappings.
  • A set of user selectable properties for tailoring the behaviour of the descriptor.

This descriptor subclass should be used for object-relational mapping, and allows for other datatype mappings to be done in the XML, EIS and OR sibling classes.

see
DescriptorEventManager
see
DescriptorQueryManager
see
InheritancePolicy
see
InterfacePolicy

Fields Summary
Constructors Summary
public RelationalDescriptor()
PUBLIC: Return a new descriptor.

        super();
    
Methods Summary
public voidaddTableName(java.lang.String tableName)
PUBLIC: Specify the table name for the class of objects the receiver describes. If the table has a qualifier it should be specified using the dot notation, (i.e. "userid.employee"). This method is used if there is more than one table.

        super.addTableName(tableName);
    
public java.lang.StringgetTableName()
PUBLIC: Return the name of the descriptor's first table. This method must only be called on single table descriptors.

        return super.getTableName();
    
public java.util.VectorgetTableNames()
PUBLIC: Return the table names.

        return super.getTableNames();
    
public voidsetDefaultTableName(java.lang.String defaultTableName)
PUBLIC: The descriptors default table can be configured if the first table is not desired.

        super.setDefaultTableName(defaultTableName);
    
public voidsetTableName(java.lang.String tableName)
PUBLIC: Specify the table name for the class of objects the receiver describes. If the table has a qualifier it should be specified using the dot notation, (i.e. "userid.employee"). This method is used for single table.

        super.setTableName(tableName);
    
public voidsetTableNames(java.util.Vector tableNames)
PUBLIC: Specify the all table names for the class of objects the receiver describes. If the table has a qualifier it should be specified using the dot notation, (i.e. "userid.employee"). This method is used for multiple tables

        super.setTableNames(tableNames);
    
public voidsetTableQualifier(java.lang.String tableQualifier)
PUBLIC: Set the table Qualifier for this descriptor. This table creator will be used for all tables in this descriptor

        super.setTableQualifier(tableQualifier);