Class AbstractPCResultObjectProvider

  • All Implemented Interfaces:
    PCResultObjectProvider, org.apache.openjpa.lib.rop.ResultObjectProvider, org.apache.openjpa.lib.util.Closeable

    public abstract class AbstractPCResultObjectProvider
    extends java.lang.Object
    implements PCResultObjectProvider
    Abstract implementation of PCResultObjectProvider that implements ResultObjectProvider.getResultObject() by assembling the necessary information about the object to be loaded.
    Author:
    Patrick Linskey
    • Constructor Detail

      • AbstractPCResultObjectProvider

        public AbstractPCResultObjectProvider​(StoreContext ctx)
        Create a new provider for loading PC objects from the input into ctx.
    • Method Detail

      • getContext

        public StoreContext getContext()
        Return the context this provider was constructed with.
      • getResultObject

        public java.lang.Object getResultObject()
                                         throws java.lang.Exception
        Specified by:
        getResultObject in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        Throws:
        java.lang.Exception
      • getObjectId

        protected abstract java.lang.Object getObjectId​(ClassMetaData meta)
                                                 throws java.lang.Exception
        Implement this method to extract the object id value from the current record of the input.
        Throws:
        java.lang.Exception
      • getPCType

        protected abstract java.lang.Class getPCType()
                                              throws java.lang.Exception
        Implement this method to extract the type of the pc stored in the current record of the input.
        Throws:
        java.lang.Exception
      • open

        public void open()
                  throws java.lang.Exception
        Override if desired. Does nothing by default.
        Specified by:
        open in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        Throws:
        java.lang.Exception
      • supportsRandomAccess

        public boolean supportsRandomAccess()
        Override if desired. Returns false by default.
        Specified by:
        supportsRandomAccess in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        See Also:
        ResultObjectProvider.supportsRandomAccess()
      • next

        public abstract boolean next()
                              throws java.lang.Exception
        Implement this method to advance the input.
        Specified by:
        next in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        Throws:
        java.lang.Exception
        See Also:
        ResultObjectProvider.next()
      • absolute

        public boolean absolute​(int pos)
                         throws java.lang.Exception
        Override if desired. Throws an exception by default.
        Specified by:
        absolute in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        Throws:
        java.lang.Exception
        See Also:
        ResultObjectProvider.absolute(int)
      • size

        public int size()
                 throws java.lang.Exception
        Override if desired. Returns Integer.MAX_VALUE by default.
        Specified by:
        size in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        Throws:
        java.lang.Exception
        See Also:
        ResultObjectProvider.size()
      • reset

        public void reset()
                   throws java.lang.Exception
        Override if desired. Throws an exception by default.
        Specified by:
        reset in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        Throws:
        java.lang.Exception
        See Also:
        ResultObjectProvider.reset()
      • close

        public void close()
                   throws java.lang.Exception
        Override if desired. Does nothing by default.
        Specified by:
        close in interface org.apache.openjpa.lib.util.Closeable
        Specified by:
        close in interface org.apache.openjpa.lib.rop.ResultObjectProvider
        Throws:
        java.lang.Exception
        See Also:
        ResultObjectProvider.close()
      • handleCheckedException

        public void handleCheckedException​(java.lang.Exception e)
        Throws a StoreException by default.
        Specified by:
        handleCheckedException in interface org.apache.openjpa.lib.rop.ResultObjectProvider