com.bm.introspectors.relations
Class AbstractRelation

java.lang.Object
  extended by com.bm.introspectors.relations.AbstractRelation
All Implemented Interfaces:
EntityReleationInfo
Direct Known Subclasses:
ManyToOneReleation, OneToManyReleation

public abstract class AbstractRelation
extends java.lang.Object
implements EntityReleationInfo

Abstract class for representation of relations.

Author:
Daniel Wiese

Constructor Summary
AbstractRelation(java.lang.Class sourceClass, java.lang.Class targetClass, Property sourceProperty, Property targetProperty, javax.persistence.FetchType fetchType, javax.persistence.CascadeType[] cascadeType)
          Default constructor.
 
Method Summary
 javax.persistence.CascadeType[] getCascadeType()
          Returns the cascadeType.
 javax.persistence.FetchType getFetchType()
          Returns the fetchType.
 java.lang.Class getSourceClass()
          Returns the sourceClass.
 Property getSourceProperty()
          Returns the sourceProperty.
 java.lang.Class getTargetClass()
          Returns the targetClass.
 java.util.Set<Property> getTargetKeyProperty()
          Returns the primary key property (or properties, in case of a composite key) for the class that is target of the relation
 Property getTargetProperty()
          Returns the targetProperty.
 boolean isCascadeOnDelete()
          True wenn the delete operatio is cascading.
 boolean isUnidirectional()
          If the preperty is unidirectional.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bm.introspectors.relations.EntityReleationInfo
getReleationType
 

Constructor Detail

AbstractRelation

public AbstractRelation(java.lang.Class sourceClass,
                        java.lang.Class targetClass,
                        Property sourceProperty,
                        Property targetProperty,
                        javax.persistence.FetchType fetchType,
                        javax.persistence.CascadeType[] cascadeType)
Default constructor.

Parameters:
sourceClass - - the type of the source entity bean
targetClass - - the type of the target entity bean
sourceProperty - - the property of the source entity bean
targetProperty - - the property of the target entity bean
fetchType - - fetch type
cascadeType - - cascade type
Method Detail

getCascadeType

public javax.persistence.CascadeType[] getCascadeType()
Returns the cascadeType.

Returns:
Returns the cascadeType.

getFetchType

public javax.persistence.FetchType getFetchType()
Returns the fetchType.

Returns:
Returns the fetchType.

getSourceClass

public java.lang.Class getSourceClass()
Returns the sourceClass.

Returns:
Returns the sourceClass.

getSourceProperty

public Property getSourceProperty()
Returns the sourceProperty.

Returns:
Returns the sourceProperty.

getTargetClass

public java.lang.Class getTargetClass()
Returns the targetClass.

Returns:
Returns the targetClass.

getTargetProperty

public Property getTargetProperty()
Returns the targetProperty.

Returns:
Returns the targetProperty.

isUnidirectional

public boolean isUnidirectional()
If the preperty is unidirectional.

Specified by:
isUnidirectional in interface EntityReleationInfo
Returns:
the isUnidirectional

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

isCascadeOnDelete

public boolean isCascadeOnDelete()
True wenn the delete operatio is cascading.

Specified by:
isCascadeOnDelete in interface EntityReleationInfo
Returns:
when the delete operation is cascading

getTargetKeyProperty

public java.util.Set<Property> getTargetKeyProperty()
Returns the primary key property (or properties, in case of a composite key) for the class that is target of the relation

Specified by:
getTargetKeyProperty in interface EntityReleationInfo
Returns:
primary key property / properties.


Copyright © 2008. All Rights Reserved.