Class OracleBlobColumnMapping

    • Constructor Detail

      • OracleBlobColumnMapping

        public OracleBlobColumnMapping​(JavaTypeMapping mapping,
                                       RDBMSStoreManager storeMgr,
                                       Column col)
        Constructor.
        Parameters:
        mapping - The Java mapping
        storeMgr - Store Manager in use
        col - Column
      • OracleBlobColumnMapping

        protected OracleBlobColumnMapping​(RDBMSStoreManager storeMgr,
                                          JavaTypeMapping mapping)
        Constructor.
        Parameters:
        storeMgr - Store Manager
        mapping - The Java mapping
    • Method Detail

      • getObject

        public Object getObject​(ResultSet rs,
                                int param)
        Returns the object to be loaded from the Orale BLOB.
        Specified by:
        getObject in interface ColumnMapping
        Overrides:
        getObject in class AbstractColumnMapping
        Parameters:
        rs - the ResultSet from the query
        param - the index in the query
        Returns:
        the object loaded as a byte[]
        Throws:
        org.datanucleus.exceptions.NucleusDataStoreException - Thrown if an error occurs in datastore communication
      • includeInSQLFetchStatement

        public boolean includeInSQLFetchStatement()
        Whether to include this mapping in a fetch statement.
        Returns:
        Whether to include it when fetching the object
      • updatePostProcessing

        public void updatePostProcessing​(org.datanucleus.state.ObjectProvider op,
                                         Object value)
        Description copied from interface: ColumnMappingPostUpdate
        Perform any UPDATE post processing on this column, using the provided value.
        Specified by:
        updatePostProcessing in interface ColumnMappingPostUpdate
        Parameters:
        op - ObjectProvider for object being updated
        value - The value to use on the UPDATE
      • insertPostProcessing

        public void insertPostProcessing​(org.datanucleus.state.ObjectProvider op,
                                         Object value)
        Description copied from interface: ColumnMappingPostInsert
        Perform any INSERT post processing on this column, using the provided value.
        Specified by:
        insertPostProcessing in interface ColumnMappingPostInsert
        Parameters:
        op - ObjectProvider for object being inserted
        value - The value to use on the insert
      • updateBlobColumn

        public static void updateBlobColumn​(org.datanucleus.state.ObjectProvider op,
                                            Table table,
                                            ColumnMapping mapping,
                                            byte[] bytes)
        Convenience method to update the contents of a BLOB column. Oracle requires that a BLOB is initialised with EMPTY_BLOB() and then you retrieve the column and update its BLOB value. Performs a statement
         SELECT {blobColumn} FROM TABLE WHERE ID=? FOR UPDATE
         
        and then updates the Blob value returned.
        Parameters:
        op - ObjectProvider of the object
        table - Table storing the BLOB column
        mapping - Datastore mapping for the BLOB column
        bytes - The bytes to store in the BLOB
        Throws:
        org.datanucleus.exceptions.NucleusObjectNotFoundException - thrown if an object isnt found
        org.datanucleus.exceptions.NucleusDataStoreException - thrown if an error occurs in datastore communication