Class FederatedPersistenceHandler

  • All Implemented Interfaces:
    StorePersistenceHandler

    public class FederatedPersistenceHandler
    extends java.lang.Object
    implements StorePersistenceHandler
    Persistence handler for federated datastores. Distributes the inserts/updates/deletes/fetches to the appropriate datastore.
    • Constructor Detail

      • FederatedPersistenceHandler

        public FederatedPersistenceHandler​(StoreManager storeMgr)
        Constructor.
        Parameters:
        storeMgr - StoreManager
    • Method Detail

      • useReferentialIntegrity

        public boolean useReferentialIntegrity()
      • updateObject

        public void updateObject​(DNStateManager sm,
                                 int[] fieldNumbers)
        Description copied from interface: StorePersistenceHandler
        Updates a persistent object in the datastore.
        Specified by:
        updateObject in interface StorePersistenceHandler
        Parameters:
        sm - StateManager of the object to be updated.
        fieldNumbers - The numbers of the fields to be updated.
      • fetchObject

        public void fetchObject​(DNStateManager sm,
                                int[] fieldNumbers)
        Description copied from interface: StorePersistenceHandler
        Fetches specified fields of a persistent object from the database.
        Specified by:
        fetchObject in interface StorePersistenceHandler
        Parameters:
        sm - StateManager of the object to be fetched.
        fieldNumbers - The numbers of the fields to be fetched.
      • fetchObjects

        public void fetchObjects​(int[] fieldNumbers,
                                 DNStateManager... sms)
        Description copied from interface: StorePersistenceHandler
        Fetches specified fields of several persistent objects (of the same type) from the database.
        Specified by:
        fetchObjects in interface StorePersistenceHandler
        Parameters:
        fieldNumbers - The numbers of the fields to be fetched.
        sms - StateManagers of the objects to be fetched.
      • findObject

        public java.lang.Object findObject​(ExecutionContext ec,
                                           java.lang.Object id)
        Description copied from interface: StorePersistenceHandler
        Method to find a persistable object with the specified id from the datastore, if the StoreManager supports this operation (optional). This allows for datastores that perform the instantiation of objects directly (such as ODBMS). With other types of datastores (e.g RDBMS) this method returns null.
        Specified by:
        findObject in interface StorePersistenceHandler
        Parameters:
        ec - The ExecutionContext
        id - the id of the object in question.
        Returns:
        a persistable object with a valid object state (for example: hollow) or null, indicating that the implementation leaves the instantiation work to DataNucleus.
      • findObjects

        public java.lang.Object[] findObjects​(ExecutionContext ec,
                                              java.lang.Object[] ids)
        Description copied from interface: StorePersistenceHandler
        Method to find an array of objects with the specified identities from the datastore. This allows for datastores that perform the instantiation of objects directly (such as ODBMS). With other types of datastores (e.g RDBMS) this method returns null.
        Specified by:
        findObjects in interface StorePersistenceHandler
        Parameters:
        ec - The ExecutionContext
        ids - identities of the object(s) to retrieve
        Returns:
        The persistable objects with these identities (in the same order as
        ids
        )
      • findObjectForUnique

        public java.lang.Object findObjectForUnique​(ExecutionContext ec,
                                                    AbstractClassMetaData cmd,
                                                    java.lang.String[] memberNames,
                                                    java.lang.Object[] values)
        Description copied from interface: StorePersistenceHandler
        Method to find the object with the specified value(s) for the member(s) of the specified type.
        Specified by:
        findObjectForUnique in interface StorePersistenceHandler
        Parameters:
        ec - ExecutionContext
        cmd - Metadata for the class in question
        memberNames - Member(s) that define the object
        values - Value(s) for the member(s)
        Returns:
        The object with these member value(s)