org.plasma.sdo.access.model
Class Entity

java.lang.Object
  extended by org.plasma.sdo.access.model.Entity
All Implemented Interfaces:
DataEntity

public abstract class Entity
extends Object
implements DataEntity


Constructor Summary
Entity()
           
 
Method Summary
 void accept(EntityGraphVisitor visitor, TraversalMap traversalMap)
          This recursive traversal algorithm is based on the Visitor Pattern and is capable of only breadth-first traversals.
 void accept(EntityVisitor visitor)
          This recursive traversal algorithm is based on the Visitor Pattern and is capable of both breadth-first and depth-first traversals.
 void accept(EntityVisitor visitor, boolean depthFirst)
          Variant of above.
 void add(String name, Object o)
          Generic reflection-based 'adder'.
 Object get(String name)
          Generic reflection-based 'getter'.
 Object getEntityId()
          Returns the value for the id property, often the property associated with the DB primary key.
 String getHashKey()
           
 Property getIdProperty()
           
 String getNamespaceURI()
           
 Type getType()
           
 Object set(String name, Object o)
          Generic reflection-based 'setter'.
 Object setEntityId(Object id)
          Sets the value for the id property, often the property associated with the DB primary key.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entity

public Entity()
Method Detail

get

public Object get(String name)
           throws IllegalAccessException,
                  IllegalArgumentException,
                  InvocationTargetException
Generic reflection-based 'getter'. Finds the specific getter method based on the given property name and 'this' class and invokes it.

Specified by:
get in interface DataEntity
Parameters:
- - the property name
Returns:
- the value
Throws:
IllegalAccessException
IllegalArgumentException
InvocationTargetException

set

public Object set(String name,
                  Object o)
           throws IllegalAccessException,
                  IllegalArgumentException,
                  InvocationTargetException
Generic reflection-based 'setter'. Finds the specific setter method based on the given property name and 'this' class and invokes it using the given value.

Specified by:
set in interface DataEntity
Parameters:
- - the property name
- - the value to set
Returns:
- the old value
Throws:
IllegalAccessException
IllegalArgumentException
InvocationTargetException

add

public void add(String name,
                Object o)
         throws IllegalAccessException,
                IllegalArgumentException,
                InvocationTargetException
Generic reflection-based 'adder'. Finds the specific adder method based on the given property name and 'this' class and invokes it using the given value.

Specified by:
add in interface DataEntity
Parameters:
- - the property name
- - the value to add
Throws:
IllegalAccessException
IllegalArgumentException
InvocationTargetException

getEntityId

public Object getEntityId()
                   throws IllegalAccessException,
                          IllegalArgumentException,
                          InvocationTargetException
Returns the value for the id property, often the property associated with the DB primary key.

Specified by:
getEntityId in interface DataEntity
Throws:
IllegalAccessException
IllegalArgumentException
InvocationTargetException

setEntityId

public Object setEntityId(Object id)
                   throws IllegalAccessException,
                          IllegalArgumentException,
                          InvocationTargetException
Sets the value for the id property, often the property associated with the DB primary key.

Specified by:
setEntityId in interface DataEntity
Parameters:
- - the id value
Throws:
IllegalAccessException
IllegalArgumentException
InvocationTargetException

accept

public void accept(EntityVisitor visitor)
This recursive traversal algorithm is based on the Visitor Pattern and is capable of both breadth-first and depth-first traversals. The entry point is found in the Entity.accept(IPOMVisitor visitor) method. It assumes a strict hierarchy of POM objects linked through reference properties. Within contexts where other than strict hierarchical structures are possible, the associated graph traversal algorithm should be used instead Though this algorithm will traverse any structure including a hierarchy, graph or network without errors, the traversal path could be undesirable except for strict hierarchies.

Specified by:
accept in interface DataEntity
Parameters:
- - the visitor

accept

public void accept(EntityVisitor visitor,
                   boolean depthFirst)
Variant of above.

Specified by:
accept in interface DataEntity

accept

public void accept(EntityGraphVisitor visitor,
                   TraversalMap traversalMap)
This recursive traversal algorithm is based on the Visitor Pattern and is capable of only breadth-first traversals. It assumes a complex POM graph linked through reference properties. Within contexts where a strict hierarchical structure can be guaranteed, the associated hierarchy traversal algorithm should be used instead. This algorithm relies on a "traversal map" which is a structure which maps property name path strings, in the format '/shipment/orders', to property name string arrays.

Parameters:
- - the graph visitor
- - the traversal map

getNamespaceURI

public String getNamespaceURI()

getType

public Type getType()
Specified by:
getType in interface DataEntity

getIdProperty

public Property getIdProperty()
Specified by:
getIdProperty in interface DataEntity

getHashKey

public String getHashKey()
                  throws IllegalArgumentException,
                         IllegalAccessException,
                         InvocationTargetException
Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All rights reserved.