Class DefaultPObjectFactory

java.lang.Object
com.polarion.platform.persistence.spi.DefaultPObjectFactory
All Implemented Interfaces:
IPObjectFactory, ITypedWrapperFactory

public class DefaultPObjectFactory extends Object implements IPObjectFactory
Author:
dobisekm
  • Constructor Details

    • DefaultPObjectFactory

      public DefaultPObjectFactory()
  • Method Details

    • createObjectForURI

      public IPObject createObjectForURI(SubterraURI uri, IDataService persistence)
      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 interface IPObjectFactory
      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 interface IPObjectFactory
      Returns:
      The IPObject implementing the model-specific interface (if specified) or just a generic IPObject if none specified.
    • createNewObject

      public IPObject createNewObject(IPrototype prototype, IDataService persistence)
      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 interface IPObjectFactory
      Returns:
      the IPObject instance created
    • getCommonSuperclass

      public Class getCommonSuperclass()
      Specified by:
      getCommonSuperclass in interface ITypedWrapperFactory
      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.