All Downloads are FREE. Search and download functionalities are using the official Maven repository.

oracle.toplink.essentials.descriptors.RelationalDescriptor Maven / Gradle / Ivy

The newest version!
/*
 * The contents of this file are subject to the terms 
 * of the Common Development and Distribution License 
 * (the "License").  You may not use this file except 
 * in compliance with the License.
 * 
 * You can obtain a copy of the license at 
 * glassfish/bootstrap/legal/CDDLv1.0.txt or 
 * https://glassfish.dev.java.net/public/CDDLv1.0.html. 
 * See the License for the specific language governing 
 * permissions and limitations under the License.
 * 
 * When distributing Covered Code, include this CDDL 
 * HEADER in each file and include the License file at 
 * glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable, 
 * add the following below this CDDL HEADER, with the 
 * fields enclosed by brackets "[]" replaced with your 
 * own identifying information: Portions Copyright [yyyy] 
 * [name of copyright owner]
 */
// Copyright (c) 1998, 2005, Oracle. All rights reserved.  
package oracle.toplink.essentials.descriptors;

import java.util.*;
import oracle.toplink.essentials.exceptions.*;

/**
 * 

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 */ public class RelationalDescriptor extends ClassDescriptor { /** * PUBLIC: * Return a new descriptor. */ public RelationalDescriptor() { super(); } /** * 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. */ public void addTableName(String tableName) { super.addTableName(tableName); } /** * PUBLIC: * Return the name of the descriptor's first table. * This method must only be called on single table descriptors. */ public String getTableName() { return super.getTableName(); } /** * PUBLIC: * Return the table names. */ public Vector getTableNames() { return super.getTableNames(); } /** * PUBLIC: * The descriptors default table can be configured if the first table is not desired. */ public void setDefaultTableName(String defaultTableName) { super.setDefaultTableName(defaultTableName); } /** * 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. */ public void setTableName(String tableName) throws DescriptorException { super.setTableName(tableName); } /** * 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 */ public void setTableNames(Vector tableNames) { super.setTableNames(tableNames); } /** * PUBLIC: Set the table Qualifier for this descriptor. This table creator will be used for * all tables in this descriptor */ public void setTableQualifier(String tableQualifier) { super.setTableQualifier(tableQualifier); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy