Class DefaultPObjectFactory
java.lang.Object
com.polarion.platform.persistence.spi.DefaultPObjectFactory
- All Implemented Interfaces:
IPObjectFactory
,ITypedWrapperFactory
- Author:
- dobisekm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNewObject
(IPrototype prototype, IDataService persistence) Creates instance of correct type, which is not persistent yet.createObjectForDAO
(com.polarion.subterra.base.data.object.IDataObject dao, IDataService persistence) Creates instance of the correct type, wrapping the given data object.createObjectForURI
(SubterraURI uri, IDataService persistence) Creates instance of the correct type for the given URI.
-
Constructor Details
-
DefaultPObjectFactory
public DefaultPObjectFactory()
-
-
Method Details
-
createObjectForURI
Description copied from interface:IPObjectFactory
Creates instance of the correct type for the given URI. Implementors of this method do not need to perform checks for URI correctness, since this should be performed by the calling framework.- Specified by:
createObjectForURI
in interfaceIPObjectFactory
- Returns:
- The IPObject implementing the model-specific interface (if
specified) or just a generic
IPObject
if none specified.
-
createObjectForDAO
public IPObject createObjectForDAO(com.polarion.subterra.base.data.object.IDataObject dao, IDataService persistence) Description copied from interface:IPObjectFactory
Creates instance of the correct type, wrapping the given data object. Implementors of this method do not need to perform checks for URI correctness, since this should be performed by the calling framework.- Specified by:
createObjectForDAO
in interfaceIPObjectFactory
- Returns:
- The IPObject implementing the model-specific interface (if
specified) or just a generic
IPObject
if none specified.
-
createNewObject
Description copied from interface:IPObjectFactory
Creates instance of correct type, which is not persistent yet. (temporary object). Used during the creation process.- Specified by:
createNewObject
in interfaceIPObjectFactory
- Returns:
- the
IPObject
instance created
-
getCommonSuperclass
- Specified by:
getCommonSuperclass
in interfaceITypedWrapperFactory
- Returns:
- The interface implemented by all instances created by this
factory.
The returned class must follow the inheritance structure from the model. Therefore the returned class must also be instanceof of the classes returned by their supertype factories (applies to
IPObject
wrappers only.
-