org.apache.ojb.broker.metadata
Class CollectionDescriptor

java.lang.Object
  extended byorg.apache.ojb.broker.metadata.DescriptorBase
      extended byorg.apache.ojb.broker.metadata.AttributeDescriptorBase
          extended byorg.apache.ojb.broker.metadata.ObjectReferenceDescriptor
              extended byorg.apache.ojb.broker.metadata.CollectionDescriptor
All Implemented Interfaces:
AttributeContainer, RepositoryElements, java.io.Serializable, XmlCapable

public class CollectionDescriptor
extends ObjectReferenceDescriptor

mapping Description for member fields that are Collections
Note: Be careful when use references of this class or caching instances of this class, because instances could become invalid (see MetadataManager).

Version:
$Id: CollectionDescriptor.java,v 1.30 2004/04/04 23:53:34 brianm Exp $
Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.broker.metadata.ObjectReferenceDescriptor
CASCADE_LINK, CASCADE_NONE, CASCADE_OBJECT
 
Fields inherited from interface org.apache.ojb.broker.metadata.RepositoryElements
_NEXT, ACCEPT_LOCKS, ACCESS, ATTRIBUTE, ATTRIBUTE_NAME, ATTRIBUTE_VALUE, AUTO_DELETE, AUTO_INCREMENT, AUTO_RETRIEVE, AUTO_UPDATE, BATCH_MODE, CASCADE_LINK_STR, CASCADE_NONE_STR, CASCADE_OBJECT_STR, CLASS_DESCRIPTOR, CLASS_EXTENT, CLASS_NAME, CLASS_PROXY, CLASS_REF, COLLECTION_CLASS, COLLECTION_DESCRIPTOR, COLUMN_NAME, CON_LOG_ABANDONED, CON_MAX_ACTIVE, CON_MAX_IDLE, CON_MAX_WAIT, CON_MIN_EVICTABLE_IDLE_TIME_MILLIS, CON_NUM_TESTS_PER_EVICTION_RUN, CON_REMOVE_ABANDONED, CON_REMOVE_ABANDONED_TIMEOUT, CON_TEST_ON_BORROW, CON_TEST_ON_RETURN, CON_TEST_WHILE_IDLE, CON_TIME_BETWEEN_EVICTION_RUNS_MILLIS, CON_WHEN_EXHAUSTED_ACTION, CONNECTION_FACTORY, CONNECTION_POOL, CONSTANT_ARGUMENT, DATASOURCE_NAME, DBMS_NAME, DEFAULT_CONNECTION, DELETE_PROCEDURE, DOCUMENTATION, DRIVER_NAME, EAGER_RELEASE, EXTENDS, FACTORY_CLASS, FACTORY_METHOD, FIELD_CONVERSION, FIELD_DESCRIPTOR, FIELD_ID_REF, FIELD_NAME, FIELD_REF, FK_POINTING_TO_ITEMS_CLASS, FK_POINTING_TO_THIS_CLASS, FOREIGN_KEY, ID, IGNORE_AUTOCOMMIT_EXCEPTION, INCLUDE_ALL_FIELDS, INCLUDE_PK_FIELDS_ONLY, INDEX_COLUMN, INDEX_DESCRIPTOR, INDEXED, INDIRECTION_TABLE, INITIALIZATION_METHOD, INSERT_PROCEDURE, INVERSE_FK, ISOLATION_LEVEL, ITEMS_CLASS, JCD_ALIAS, JDBC_CONNECTION_DESCRIPTOR, JDBC_LEVEL, JDBC_TYPE, LENGTH, LOCKING, MAPPING_REPOSITORY, NAME, NULLABLE, OBJECT_CACHE, ORDERBY, OTM_DEPENDENT, PRECISION, PRIMARY_KEY, PROXY_PREFETCHING_LIMIT, PROXY_REFERENCE, QUERY_CUSTOMIZER, REFERENCE_DESCRIPTOR, REFERENCED_CLASS, REFRESH, REPOSITORY_VERSION, RETURN, RETURN_FIELD_REF, ROW_READER, RUNTIME_ARGUMENT, SCALE, SCHEMA_NAME, SEQUENCE_MANAGER, SEQUENCE_MANAGER_CLASS, SEQUENCE_NAME, SORT, TABLE_NAME, TAG_ACCESS, TAG_ACCESS_ANONYMOUS, TAG_ACCESS_READONLY, TAG_ACCESS_READWRITE, TAG_SUPER, UNIQUE, UPDATE_LOCK, UPDATE_PROCEDURE, URL_DBALIAS, URL_PROTOCOL, URL_SUBPROTOCOL, USE_AUTOCOMMIT, USER_NAME, USER_PASSWD, VALIDATION_QUERY, VALUE
 
Constructor Summary
CollectionDescriptor(ClassDescriptor descriptor)
           
 
Method Summary
 void addFkToItemClass(java.lang.String column)
          add a FK column pointing to the item Class
 void addFkToThisClass(java.lang.String column)
          add a FK column pointing to This Class
 void addOrderBy(java.lang.String fieldName, boolean sortAscending)
          Adds a field for orderBy
 java.lang.Class getCollectionClass()
          returns the type of the collection.
 java.lang.String getCollectionClassName()
          Retrieve the classname of the collection.
 java.lang.String[] getFksToItemClass()
           
 java.lang.String[] getFksToThisClass()
           
 java.lang.String getIndirectionTable()
           
 java.util.Collection getOrderBy()
          Returns the orderby Collection of Fields.
 QueryCustomizer getQueryCustomizer()
           
 boolean hasProxyItems()
           
 boolean isMtoNRelation()
           
 void setCollectionClass(java.lang.Class c)
          set the type of the collection
 void setFksToItemClass(java.util.Vector fksToItemClass)
           
 void setFksToThisClass(java.util.Vector fksToThisClass)
           
 void setIndirectionTable(java.lang.String indirectionTable)
           
 void setQueryCustomizer(QueryCustomizer queryCustomizer)
          Sets the queryCustomizer.
 java.lang.String toXML()
          returns the XML marshalled version of this instance.
 
Methods inherited from class org.apache.ojb.broker.metadata.ObjectReferenceDescriptor
addForeignKeyField, addForeignKeyField, getCascadeAsString, getCascadeDelete, getCascadeRetrieve, getCascadeStore, getCascadingDelete, getCascadingStore, getForeignKeyFieldDescriptors, getForeignKeyFields, getForeignKeyValues, getItemClass, getItemClassName, getItemProxyClass, getOtmDependent, getProxyPrefetchingLimit, isLazy, isRefresh, setCascadeDelete, setCascadeRetrieve, setCascadeStore, setCascadingDelete, setCascadingDelete, setCascadingStore, setCascadingStore, setForeignKeyFields, setItemClass, setLazy, setOtmDependent, setProxyPrefetchingLimit, setRefresh, toString
 
Methods inherited from class org.apache.ojb.broker.metadata.AttributeDescriptorBase
addAttribute, getAttribute, getAttribute, getAttributeName, getAttributeNames, getAttributes, getClassDescriptor, getPersistentField, setClassDescriptor, setPersistentField, setPersistentField
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionDescriptor

public CollectionDescriptor(ClassDescriptor descriptor)
Method Detail

getFksToThisClass

public java.lang.String[] getFksToThisClass()

setFksToThisClass

public void setFksToThisClass(java.util.Vector fksToThisClass)

addFkToThisClass

public void addFkToThisClass(java.lang.String column)
add a FK column pointing to This Class


addFkToItemClass

public void addFkToItemClass(java.lang.String column)
add a FK column pointing to the item Class


getCollectionClass

public java.lang.Class getCollectionClass()
returns the type of the collection.

Returns:
java.lang.Class

setCollectionClass

public void setCollectionClass(java.lang.Class c)
set the type of the collection

Parameters:
c - the collection type

getCollectionClassName

public java.lang.String getCollectionClassName()
Retrieve the classname of the collection.


getIndirectionTable

public java.lang.String getIndirectionTable()

setIndirectionTable

public void setIndirectionTable(java.lang.String indirectionTable)

getFksToItemClass

public java.lang.String[] getFksToItemClass()

setFksToItemClass

public void setFksToItemClass(java.util.Vector fksToItemClass)

isMtoNRelation

public boolean isMtoNRelation()

addOrderBy

public void addOrderBy(java.lang.String fieldName,
                       boolean sortAscending)
Adds a field for orderBy

Parameters:
fieldName - The field name to be used
sortAscending - true for ASCENDING, false for DESCENDING

getOrderBy

public java.util.Collection getOrderBy()
Returns the orderby Collection of Fields.

Returns:
Collection

toXML

public java.lang.String toXML()
Description copied from interface: XmlCapable
returns the XML marshalled version of this instance.

Specified by:
toXML in interface XmlCapable
Overrides:
toXML in class ObjectReferenceDescriptor

getQueryCustomizer

public QueryCustomizer getQueryCustomizer()
Returns:
QueryCustomizer

setQueryCustomizer

public void setQueryCustomizer(QueryCustomizer queryCustomizer)
Sets the queryCustomizer.

Parameters:
queryCustomizer - The queryCustomizer to set

hasProxyItems

public boolean hasProxyItems()
                      throws PersistenceBrokerException
Throws:
PersistenceBrokerException


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2