org.equanda.persistence
Class EquandaMediatorRoot<ENTITY extends EquandaEntity,BEAN extends EquandaEJB>

java.lang.Object
  extended by org.equanda.persistence.EquandaMediatorRoot<ENTITY,BEAN>
All Implemented Interfaces:
ExceptionCodes

public abstract class EquandaMediatorRoot<ENTITY extends EquandaEntity,BEAN extends EquandaEJB>
extends Object
implements ExceptionCodes

Abstract base for all mediator root classes

Author:
Joachim Van der Auwera

Field Summary
protected  javax.persistence.EntityManager em
           
protected  ENTITY entity
           
protected  BEAN object
           
 
Fields inherited from interface org.equanda.client.ExceptionCodes
CME_DATA_HAS_BEEN_ALREADY_CHANGED, ECV_CANNOT_ADD_NULL_TO_MULTIPLE_FIELD, ECV_CASCADE_KEEP, ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED, ECV_CONSTRAINT_VIOLATION, ECV_COULD_NOT_TEST_CHOICES_USING_CLASS, ECV_DOWNCAST_CREATE_ERROR, ECV_DOWNCAST_FAILED_CANNOT_DOWNCAST_ROOT, ECV_DOWNCAST_SELECTOR_ERROR, ECV_FAILED_TO_CREATE_INCLUDED_VALUE, ECV_FAILED_TO_UPDATE_VALUE, ECV_FIELD_IS_REQUIRED, ECV_FIELD_IS_UNIQUE, ECV_IMMUTABLE_IF_OTHER_FIELD_IS_SET, ECV_INCLUDE_VALUE_HAS_WRONG_TYPE, ECV_INTERNAL_ERROR_ON_CREATE_INCLUDED_VALUE, ECV_INVALID_TABLE_TYPE, ECV_OTHERSIDE_EMBEDDED_FIELD_IMMUTABLE_ONCE_SET, ECV_VALUE_IS_NOT_ONE_OF_THE_CHOICES, EE_CANNOT_CREATE_LAZYCOLLECTION, EE_CANNOT_INIT_BEAN, EE_FAILED_PROXY_REMOVE, EE_FAILED_TO_UPDATE_VALUE, EE_OBJECT_NOT_FOUND, EPE_NULL_UOID_INVALID, EPE_PERSISTENCE_EXCEPTION, EPE_UOID_NOT_FOUND, UONA_OPERATION_NOT_ALLOWED
 
Constructor Summary
EquandaMediatorRoot()
           
 
Method Summary
protected  void checkImmutableIf(String field, String exclude)
           
 void create()
           
 void equandaCheckRules()
          utility routine to allow checking the integrity of the record
 Timestamp getEquandaCreationDate()
           
 ENTITY getEquandaEntity()
           
 Timestamp getEquandaModificationDate()
           
 String getEquandaStatus()
           
 String getEquandaType()
           
abstract  ObjectType getEquandaTypeObject()
           
 long getEquandaVersion()
           
 Uoid getId()
           
 void init(ENTITY entity, BEAN object, javax.persistence.EntityManager em)
           
abstract  boolean isEquandaParentType(String type)
           
abstract  boolean isEquandaType(String type)
           
 void setEquandaStatus(String status)
           
protected  boolean testEquals(Object obj1, Object obj2)
          utility routine to test equality of objects without relying on one of them being not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

em

protected javax.persistence.EntityManager em

entity

protected ENTITY extends EquandaEntity entity

object

protected BEAN extends EquandaEJB object
Constructor Detail

EquandaMediatorRoot

public EquandaMediatorRoot()
Method Detail

init

public void init(ENTITY entity,
                 BEAN object,
                 javax.persistence.EntityManager em)

getEquandaEntity

public ENTITY getEquandaEntity()

getId

public Uoid getId()

getEquandaType

public String getEquandaType()

getEquandaModificationDate

public Timestamp getEquandaModificationDate()

getEquandaCreationDate

public Timestamp getEquandaCreationDate()

getEquandaVersion

public long getEquandaVersion()

getEquandaStatus

public String getEquandaStatus()

setEquandaStatus

public void setEquandaStatus(String status)

create

public void create()
            throws EquandaException
Throws:
EquandaException

isEquandaType

public abstract boolean isEquandaType(String type)

isEquandaParentType

public abstract boolean isEquandaParentType(String type)

getEquandaTypeObject

public abstract ObjectType getEquandaTypeObject()

checkImmutableIf

protected void checkImmutableIf(String field,
                                String exclude)
                         throws EquandaException
Throws:
EquandaException

testEquals

protected boolean testEquals(Object obj1,
                             Object obj2)
utility routine to test equality of objects without relying on one of them being not null.

Parameters:
obj1 - one of the objects to compare
obj2 - other object to compare
Returns:
true when bot objects are equal

equandaCheckRules

public void equandaCheckRules()
                       throws EquandaException
utility routine to allow checking the integrity of the record

Throws:
EquandaException - when constraints are violated


Copyright © 2007-2009. All Rights Reserved.