Class RelationalDescriptor

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    DescriptorEventManager, DescriptorQueryManager, InheritancePolicy, InterfacePolicy, Serialized Form
    • Constructor Detail

      • RelationalDescriptor

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

      • isRelationalDescriptor

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

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

        public java.lang.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 java.util.Vector getTableNames()
        PUBLIC: Return the table names.
        Overrides:
        getTableNames in class ClassDescriptor
      • setDefaultTableName

        public void setDefaultTableName​(java.lang.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​(java.lang.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​(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
        Overrides:
        setTableNames in class ClassDescriptor
      • setTableQualifier

        public void setTableQualifier​(java.lang.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