uk.nominet.catnap.framework
Class EntityDef

java.lang.Object
  extended byuk.nominet.catnap.framework.EntityDef

public class EntityDef
extends java.lang.Object

EntityDef describing a database/java object mapping. has two primary members name - the name of the entity classname - the fully qualified mapped java class for this entity.


Constructor Summary
EntityDef(java.lang.String name, java.lang.String classname, EntityDef parentDef, boolean readOnly, boolean isTransient)
          Main constructor with name and classname.
 
Method Summary
 java.util.List getAllCascadingRelatedMembers()
           
 java.util.List getAllHierarchicalMembers()
          Get all of the members contained within this entity, along with all members contained in any parent entities recursively.
 java.util.List getAllRelatedMembers()
          Get all related members.
 java.util.List getAllUnrelatedMembers()
          Get all members which are not involved in a relationship
 EntityDef getCascadingParentEntity()
          Get the parent entity def if one exists for this entity.
 java.lang.String getCreateProc()
          Get the create procedure for the entity.
 java.util.List getCreateProcMembers()
          Get all members which are involved in the write to a create procedure.
 java.lang.String getDeleteProc()
          Get the delete procedure name for the entity.
 java.lang.String getFinder()
          Get the default finder
 java.util.List getHasManyMembers()
          Get all members which have a has many relationship with this entity.
 java.util.List getHasOneMembers()
          Get all members which have a has one relationship with this entity.
 Member getHierarchicalMember(java.lang.String memberName)
          Get a hierarchical member if it exists.
 java.lang.Class getJavaClass()
          Return the reflective class which this entity represents
 Member getMember(java.lang.String memberName)
          Get a member by name
 java.util.List getMembers()
          Get all of the members contained within this entity.
 java.lang.String getName()
          Return the name of this entity
 java.util.List getPKMembers()
          Get all primary key members.
 java.lang.String getUpdateProc()
          Get the update procedure for the entity.
 java.util.List getUpdateProcMembers()
          Get all members which are involved in the write to an update procedure.
 boolean isReadOnly()
           
 boolean isTransient()
           
 void mergeInteractionMethods(EntityDef otherEntityDef)
           
 void mergeOtherEntity(EntityDef otherEntityDef)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityDef

public EntityDef(java.lang.String name,
                 java.lang.String classname,
                 EntityDef parentDef,
                 boolean readOnly,
                 boolean isTransient)
Main constructor with name and classname.

Parameters:
name -
classname -
Method Detail

getName

public java.lang.String getName()
Return the name of this entity

Returns:

getJavaClass

public java.lang.Class getJavaClass()
Return the reflective class which this entity represents

Returns:

getMembers

public java.util.List getMembers()
Get all of the members contained within this entity. Each element will be one of (Member, HasMany or HasOne)

Returns:

getAllHierarchicalMembers

public java.util.List getAllHierarchicalMembers()
Get all of the members contained within this entity, along with all members contained in any parent entities recursively. This is used for finder methods when we need the union of all fields.

Returns:

getPKMembers

public java.util.List getPKMembers()
Get all primary key members.

Returns:

getHasOneMembers

public java.util.List getHasOneMembers()
Get all members which have a has one relationship with this entity.

Returns:

getHasManyMembers

public java.util.List getHasManyMembers()
Get all members which have a has many relationship with this entity.

Returns:

getAllCascadingRelatedMembers

public java.util.List getAllCascadingRelatedMembers()

getUpdateProcMembers

public java.util.List getUpdateProcMembers()
Get all members which are involved in the write to an update procedure. These are all members except the hasMany members

Returns:

getAllRelatedMembers

public java.util.List getAllRelatedMembers()
Get all related members.

Returns:

getAllUnrelatedMembers

public java.util.List getAllUnrelatedMembers()
Get all members which are not involved in a relationship

Returns:

getCreateProcMembers

public java.util.List getCreateProcMembers()
Get all members which are involved in the write to a create procedure. These are all members involved in the update procedure except the pk members.

Returns:

getMember

public Member getMember(java.lang.String memberName)
Get a member by name

Parameters:
memberName -
Returns:

getHierarchicalMember

public Member getHierarchicalMember(java.lang.String memberName)
Get a hierarchical member if it exists. i.e. traverse the inheritance tree for the entity to see whether or not the member exists higher up if not in current entity.

Parameters:
memberName -
Returns:
Member if found or exception otherwise.

getFinder

public java.lang.String getFinder()
Get the default finder

Returns:
String

getCreateProc

public java.lang.String getCreateProc()
Get the create procedure for the entity.

Returns:

getUpdateProc

public java.lang.String getUpdateProc()
Get the update procedure for the entity.

Returns:

getDeleteProc

public java.lang.String getDeleteProc()
Get the delete procedure name for the entity.

Returns:

isReadOnly

public boolean isReadOnly()

isTransient

public boolean isTransient()

getCascadingParentEntity

public EntityDef getCascadingParentEntity()
Get the parent entity def if one exists for this entity.

Returns:

mergeOtherEntity

public void mergeOtherEntity(EntityDef otherEntityDef)

mergeInteractionMethods

public void mergeInteractionMethods(EntityDef otherEntityDef)