Class BaseDomainType
- java.lang.Object
-
- org.openbravo.base.model.domaintype.BaseDomainType
-
- All Implemented Interfaces:
DomainType
- Direct Known Subclasses:
BaseForeignKeyDomainType
,BasePrimitiveDomainType
public abstract class BaseDomainType extends Object implements DomainType
The base class for all property types.- Author:
- mtaal
-
-
Constructor Summary
Constructors Constructor Description BaseDomainType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkObjectIsValid(BaseOBObjectDef obObject, Property property)
Checks if a certain property has a valid value taking into account other values in the object.List<Class<?>>
getClasses()
This method should be implemented by DomainTypes which require the usage of certain non-standard entities in the initialize() method.ModelProvider
getModelProvider()
Reference
getReference()
void
initialize()
Method is empty in this class, subclasses should override and call super.initialize() (to allow future additional initialization in this class).void
setModelProvider(ModelProvider modelProvider)
The reference classes are instantiated by theModelProvider
.void
setReference(Reference reference)
The ModelReference is instantiated for each reference record in AD_Reference.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openbravo.base.model.domaintype.DomainType
checkIsValidValue
-
-
-
-
Method Detail
-
initialize
public void initialize()
Method is empty in this class, subclasses should override and call super.initialize() (to allow future additional initialization in this class). Note: any subclass should clean-up and close database connections or hibernate sessions. If this is not done then the update.database task may hang when disabling foreign keys.- Specified by:
initialize
in interfaceDomainType
-
setReference
public void setReference(Reference reference)
Description copied from interface:DomainType
The ModelReference is instantiated for each reference record in AD_Reference. When it is instantiated the original id of the reference record is passed in using this method.- Specified by:
setReference
in interfaceDomainType
- Parameters:
reference
- the record for which the ModelReference is instantiated.
-
getReference
public Reference getReference()
- Specified by:
getReference
in interfaceDomainType
- Returns:
- the
Reference
record for which this instance is created.
-
getModelProvider
public ModelProvider getModelProvider()
- Specified by:
getModelProvider
in interfaceDomainType
- Returns:
- the ModelProvider used in this instance
-
setModelProvider
public void setModelProvider(ModelProvider modelProvider)
Description copied from interface:DomainType
The reference classes are instantiated by theModelProvider
. The ModelProvider can be used by the reference class to obtain other model related information.- Specified by:
setModelProvider
in interfaceDomainType
- Parameters:
modelProvider
- the ModelProvider instance responsible for building the internal and in-memory model.
-
checkObjectIsValid
public void checkObjectIsValid(BaseOBObjectDef obObject, Property property) throws ValidationException
Description copied from interface:DomainType
Checks if a certain property has a valid value taking into account other values in the object.- Specified by:
checkObjectIsValid
in interfaceDomainType
- Parameters:
obObject
- the overall object to checkproperty
- the property to check- Throws:
ValidationException
-
-