ch.elca.el4j.services.persistence.hibernate.dao.extent
Class ExtentCollection

java.lang.Object
  extended by ch.elca.el4j.services.persistence.hibernate.dao.extent.AbstractExtentPart
      extended by ch.elca.el4j.services.persistence.hibernate.dao.extent.ExtentCollection
All Implemented Interfaces:
Serializable, Comparable<AbstractExtentPart>

public class ExtentCollection
extends AbstractExtentPart

An ExtentCollection represents a collection of an entity.
Features:

For further details, see DataExtent.

Author:
Andreas Rueedlinger (ARR)
See Also:
Serialized Form
File-location:
ExtentCollection
Last check-in date:
2009-08-04 14:35:53 +0200 (Di, 04. Aug 2009) by swismer for revision 3875

Field Summary
 
Fields inherited from class ch.elca.el4j.services.persistence.hibernate.dao.extent.AbstractExtentPart
m_name, m_parent
 
Constructor Summary
ExtentCollection(Class<?> c, Method method)
          Default Creator, hidden.
ExtentCollection(String name)
          Default Creator.
ExtentCollection(String name, Class<?> c)
          Default Creator.
 
Method Summary
static ExtentCollection collection(Class<?> c, Method m)
          Returns a new Collection object, based on the given class and method.
static ExtentCollection collection(String name, Class<?> c)
          Returns a new Collection object, based on the given name and class.
static ExtentCollection collection(String name, ExtentEntity entity)
          Returns a new Collection object, based on the given name and entity.
 ExtentCollection freeze()
          Freeze the ExtentCollection, meaning that no further changes to it are possible.
 ExtentEntity getContainedEntity()
          Contained entity of the collection.
 String getId()
          
 ExtentCollection merge(ExtentCollection other)
          Merge two ExtentCollections.
 void setContainedEntity(ExtentEntity entity)
          Set the entity contained in this collection.
protected  void updateId()
          Updates the id of the extent part.
 
Methods inherited from class ch.elca.el4j.services.persistence.hibernate.dao.extent.AbstractExtentPart
compareTo, equals, firstCharLower, firstCharUpper, getMethod, getName, getParent, hashCode, nativeToString, setParent, toFieldName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtentCollection

public ExtentCollection(String name)
Default Creator.

Parameters:
name - the name of the collection

ExtentCollection

public ExtentCollection(String name,
                        Class<?> c)
Default Creator.

Parameters:
name - the name of the collection
c - the class of the contained entity

ExtentCollection

public ExtentCollection(Class<?> c,
                        Method method)
Default Creator, hidden.

Parameters:
c - the class of the contained entity
method - the method to get the collection
Method Detail

getId

public String getId()

Specified by:
getId in class AbstractExtentPart
Returns:
the id of the extent part.

updateId

protected void updateId()
Updates the id of the extent part. Should be used be children to inform its parent.

Specified by:
updateId in class AbstractExtentPart

getContainedEntity

public ExtentEntity getContainedEntity()
Contained entity of the collection.

Returns:
the name of the field.

setContainedEntity

public void setContainedEntity(ExtentEntity entity)
Set the entity contained in this collection.

Parameters:
entity - the contained entity of the collection.

collection

public static ExtentCollection collection(String name,
                                          Class<?> c)
Returns a new Collection object, based on the given name and class.

Parameters:
name - the name of the collection.
c - the class of the contained entity.
Returns:
the Collection object.

collection

public static ExtentCollection collection(Class<?> c,
                                          Method m)
Returns a new Collection object, based on the given class and method.

Parameters:
c - the class of the contained entity.
m - the method to get the collection.
Returns:
the Collection object.

collection

public static ExtentCollection collection(String name,
                                          ExtentEntity entity)
Returns a new Collection object, based on the given name and entity.

Parameters:
name - the name of the collection.
entity - the contained entity.
Returns:
the Collection object.

merge

public ExtentCollection merge(ExtentCollection other)
Merge two ExtentCollections. Returns the union of the extents. The class of the two contained entities of the collections should be the same, the name and the parent is taken from this object.

Parameters:
other - the collection to be merged with.
Returns:
the merged collection.

freeze

public ExtentCollection freeze()
Freeze the ExtentCollection, meaning that no further changes to it are possible.

Returns:
the frozen ExtentCollection.


Copyright © 2005-2011 ELCA. All Rights Reserved.