Package org.openbravo.dal.core
Class OBInstantiator
- java.lang.Object
-
- org.openbravo.dal.core.OBInstantiator
-
- All Implemented Interfaces:
Serializable
,org.hibernate.tuple.Instantiator
public class OBInstantiator extends Object implements org.hibernate.tuple.Instantiator
This class is used by Hibernate. Instantiates a Openbravo business object and sets theEntity
in this new instance. There is one OBInstantiator instance perEntity
in the system. Its main use is to support dynamic business objects which can handle runtime model changes.- Author:
- mtaal
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OBInstantiator()
OBInstantiator(org.hibernate.mapping.PersistentClass mappingInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
instantiate()
Instantiate a new instance of the entity.Object
instantiate(Serializable id)
Instantiate an instance and set its id using the parameter.boolean
isInstance(Object object)
Returns true if the object is an instance of the Entity handled by the OBInstantiator.
-
-
-
Method Detail
-
instantiate
public Object instantiate()
Instantiate a new instance of the entity.- Specified by:
instantiate
in interfaceorg.hibernate.tuple.Instantiator
-
instantiate
public Object instantiate(Serializable id)
Instantiate an instance and set its id using the parameter. Used by Hibernate when loading existing instances from the database.- Specified by:
instantiate
in interfaceorg.hibernate.tuple.Instantiator
- Parameters:
id
- the id to set in the instance
-
isInstance
public boolean isInstance(Object object)
Returns true if the object is an instance of the Entity handled by the OBInstantiator.- Specified by:
isInstance
in interfaceorg.hibernate.tuple.Instantiator
- Parameters:
object
- the object to compare with the Entity managed here- Returns:
- true if the object is an Entity managed by this class
-
-