net.sf.farrago.cwm.core
Class ElementOwnership$Hib

java.lang.Object
  extended by org.eigenbase.enki.jmi.impl.RefBaseObjectBase
      extended by org.eigenbase.enki.jmi.impl.RefAssociationBase
          extended by org.eigenbase.enki.hibernate.jmi.HibernateRefAssociation
              extended by org.eigenbase.enki.hibernate.jmi.HibernateOneToManyRefAssociation<CwmModelElement,CwmNamespace>
                  extended by net.sf.farrago.cwm.core.ElementOwnership$Hib
All Implemented Interfaces:
RefAssociation, RefBaseObject, ElementOwnership

public class ElementOwnership$Hib
extends HibernateOneToManyRefAssociation<CwmModelElement,CwmNamespace>
implements ElementOwnership

ElementOwnership association implementation. The ElementOwnership association identifies ModelElements owned by Namespaces. ModelElements may be owned by at most one Namespace. Refer to the above discussion of the Namespace class for more information on the nature of the ownership relationship between Namespaces and ModelElements.

Note: This type should not be subclassed, implemented or directly instantiated by clients. It is generated from a MOF metamodel and implemented by Enki or MDR.


Field Summary
private static String _allLinksQueryName
           
private static String _collectionTable
           
private static String _id
           
private static String _table
           
 
Fields inherited from class org.eigenbase.enki.hibernate.jmi.HibernateRefAssociation
type
 
Fields inherited from class org.eigenbase.enki.jmi.impl.RefAssociationBase
end1Class, end1Multiplicity, end1Name, end2Class, end2Multiplicity, end2Name
 
Constructor Summary
ElementOwnership$Hib(RefPackage container)
           
 
Method Summary
 boolean add(CwmModelElement ownedElement, CwmNamespace namespace)
          Creates a link between the pair of instance objects in the associations link set.
 boolean exists(CwmModelElement ownedElement, CwmNamespace namespace)
          Queries whether a link currently exists between a given pair of instance objects in the associations link set.
protected  String getAllLinksQueryName()
           
protected  String getAssociationIdentifier()
           
 String getCollectionTable()
           
 Class<? extends HibernateAssociation> getInstanceClass()
           
 HibernateAssociation.Kind getKind()
           
 CwmNamespace getNamespace(CwmModelElement ownedElement)
          Queries the instance object that is related to a particular instance object by a link in the current associations link set.
 Collection<CwmModelElement> getOwnedElement(CwmNamespace namespace)
          Queries the instance objects that are related to a particular instance object by a link in the current associations link set.
 String getTable()
           
 boolean remove(CwmModelElement ownedElement, CwmNamespace namespace)
          Removes a link between a pair of instance objects in the current associations link set.
 
Methods inherited from class org.eigenbase.enki.hibernate.jmi.HibernateOneToManyRefAssociation
getChildrenOf, getParentOf
 
Methods inherited from class org.eigenbase.enki.hibernate.jmi.HibernateRefAssociation
checkConstraints, fireAddEvent, fireAddEvent, fireAddEvent, fireRemoveEvent, fireRemoveEvent, fireRemoveEvent, fireSetEvent, getHibernateRepository, query, refAddLink, refAllLinks, refLinkExists, refRemoveLink
 
Methods inherited from class org.eigenbase.enki.jmi.impl.RefAssociationBase
checkFirstEndType, checkSecondEndType, checkTypes, getRepository, makeWrongSizeException, refImmediatePackage, refQuery, refQuery
 
Methods inherited from class org.eigenbase.enki.jmi.impl.RefBaseObjectBase
createInstance, equals, getCurrentInitializer, getEnum, getInitializer, getMofId, getTag, hashCode, invokeMethod, invokeMethod, logJmi, refMetaObject, refMofId, refOutermostPackage, refVerifyConstraints, setMofId, setRefMetaObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jmi.reflect.RefAssociation
refAddLink, refAllLinks, refLinkExists, refQuery, refQuery, refRemoveLink
 
Methods inherited from interface javax.jmi.reflect.RefBaseObject
equals, hashCode, refImmediatePackage, refMetaObject, refMofId, refOutermostPackage, refVerifyConstraints
 

Field Detail

_id

private static final String _id
See Also:
Constant Field Values

_allLinksQueryName

private static final String _allLinksQueryName
See Also:
Constant Field Values

_table

private static final String _table
See Also:
Constant Field Values

_collectionTable

private static final String _collectionTable
See Also:
Constant Field Values
Constructor Detail

ElementOwnership$Hib

public ElementOwnership$Hib(RefPackage container)
Method Detail

exists

public boolean exists(CwmModelElement ownedElement,
                      CwmNamespace namespace)
Description copied from interface: ElementOwnership
Queries whether a link currently exists between a given pair of instance objects in the associations link set.

Specified by:
exists in interface ElementOwnership
Overrides:
exists in class HibernateOneToManyRefAssociation<CwmModelElement,CwmNamespace>
Parameters:
ownedElement - Value of the first association end.
namespace - Value of the second association end.
Returns:
Returns true if the queried link exists.

getOwnedElement

public Collection<CwmModelElement> getOwnedElement(CwmNamespace namespace)
Description copied from interface: ElementOwnership
Queries the instance objects that are related to a particular instance object by a link in the current associations link set.

Specified by:
getOwnedElement in interface ElementOwnership
Parameters:
namespace - Required value of the second association end.
Returns:
Collection of related objects.

getNamespace

public CwmNamespace getNamespace(CwmModelElement ownedElement)
Description copied from interface: ElementOwnership
Queries the instance object that is related to a particular instance object by a link in the current associations link set.

Specified by:
getNamespace in interface ElementOwnership
Parameters:
ownedElement - Required value of the first association end.
Returns:
Related object or null if none exists.

add

public boolean add(CwmModelElement ownedElement,
                   CwmNamespace namespace)
Description copied from interface: ElementOwnership
Creates a link between the pair of instance objects in the associations link set.

Specified by:
add in interface ElementOwnership
Overrides:
add in class HibernateOneToManyRefAssociation<CwmModelElement,CwmNamespace>
Parameters:
ownedElement - Value of the first association end.
namespace - Value of the second association end.

remove

public boolean remove(CwmModelElement ownedElement,
                      CwmNamespace namespace)
Description copied from interface: ElementOwnership
Removes a link between a pair of instance objects in the current associations link set.

Specified by:
remove in interface ElementOwnership
Overrides:
remove in class HibernateOneToManyRefAssociation<CwmModelElement,CwmNamespace>
Parameters:
ownedElement - Value of the first association end.
namespace - Value of the second association end.

getAssociationIdentifier

protected String getAssociationIdentifier()
Specified by:
getAssociationIdentifier in class HibernateRefAssociation

getInstanceClass

public Class<? extends HibernateAssociation> getInstanceClass()
Specified by:
getInstanceClass in class HibernateRefAssociation

getKind

public HibernateAssociation.Kind getKind()
Specified by:
getKind in class HibernateRefAssociation

getAllLinksQueryName

protected String getAllLinksQueryName()
Specified by:
getAllLinksQueryName in class HibernateRefAssociation

getTable

public String getTable()
Specified by:
getTable in class HibernateRefAssociation

getCollectionTable

public String getCollectionTable()
Specified by:
getCollectionTable in class HibernateRefAssociation