Class RelationalDescriptor

java.lang.Object
org.eclipse.persistence.core.descriptors.CoreDescriptor<AttributeGroup,DescriptorEventManager,org.eclipse.persistence.internal.helper.DatabaseField,InheritancePolicy,org.eclipse.persistence.internal.descriptors.InstantiationPolicy,Vector,org.eclipse.persistence.internal.descriptors.ObjectBuilder>
org.eclipse.persistence.descriptors.ClassDescriptor
org.eclipse.persistence.descriptors.RelationalDescriptor
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ObjectRelationalDataTypeDescriptor

public class RelationalDescriptor extends ClassDescriptor

Purpose: EclipseLink 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 behavior 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 representation.

Every descriptor 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 behavior 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 Also:
  • Constructor Details

    • RelationalDescriptor

      public RelationalDescriptor()
      PUBLIC: Return a new descriptor.
  • Method Details

    • isRelationalDescriptor

      public boolean isRelationalDescriptor()
      PUBLIC: Return if the descriptor maps to a relational table.
      Overrides:
      isRelationalDescriptor in class ClassDescriptor
    • addTableName

      public void addTableName(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.
      Overrides:
      addTableName in class ClassDescriptor
    • getTableName

      public String getTableName()
      PUBLIC: Return the name of the descriptor's first table. This method must only be called on single table descriptors.
      Overrides:
      getTableName in class ClassDescriptor
    • getTableNames

      public Vector getTableNames()
      PUBLIC: Return the table names.
      Overrides:
      getTableNames in class ClassDescriptor
    • setDefaultTableName

      public void setDefaultTableName(String defaultTableName)
      PUBLIC: The descriptors default table can be configured if the first table is not desired.
      Overrides:
      setDefaultTableName in class ClassDescriptor
    • setTableName

      public void setTableName(String tableName) throws DescriptorException
      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.
      Overrides:
      setTableName in class ClassDescriptor
      Throws:
      DescriptorException
    • setTableNames

      public void setTableNames(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
      Overrides:
      setTableNames in class ClassDescriptor
    • setTableQualifier

      public void setTableQualifier(String tableQualifier)
      PUBLIC: Set the table Qualifier for this descriptor. This table creator will be used for all tables in this descriptor
      Overrides:
      setTableQualifier in class ClassDescriptor