Cumulus4j API
(1.2.0)

org.cumulus4j.store.model
Class DataEntryDAO

java.lang.Object
  extended by org.cumulus4j.store.model.AbstractDAO
      extended by org.cumulus4j.store.model.DataEntryDAO

public class DataEntryDAO
extends AbstractDAO


Field Summary
 
Fields inherited from class org.cumulus4j.store.model.AbstractDAO
pm
 
Constructor Summary
DataEntryDAO()
           
DataEntryDAO(PersistenceManager pmData, int keyStoreRefID)
          Create a new instance with the backend-PersistenceManager used for data.
 
Method Summary
 DataEntry getDataEntry(ClassMeta classMeta, String objectID)
          Get the DataEntry identified by the given type and JDO/JPA-object-ID.
 DataEntry getDataEntry(long dataEntryID)
          Get the DataEntry identified by the specified dataEntryID or null if no such instance exists.
 Long getDataEntryID(ClassMeta classMeta, String objectID)
           Get the dataEntryID of the DataEntry identified by the given type and JDO/JPA-object-ID.
 Set<Long> getDataEntryIDsNegated(ClassMeta classMeta, String notThisObjectID)
           Get the dataEntryIDs of all those DataEntry instances which do not match the given type and JDO/JPA-object-ID.
 
Methods inherited from class org.cumulus4j.store.model.AbstractDAO
getPersistenceManager, setPersistenceManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataEntryDAO

public DataEntryDAO()

DataEntryDAO

public DataEntryDAO(PersistenceManager pmData,
                    int keyStoreRefID)
Create a new instance with the backend-PersistenceManager used for data.

Parameters:
pmData - the backend-PersistenceManager. Must not be null.
keyStoreRefID - the key-store-reference-ID obtained usually from CryptoContext.getKeyStoreRefID().
Method Detail

getDataEntry

public DataEntry getDataEntry(long dataEntryID)
Get the DataEntry identified by the specified dataEntryID or null if no such instance exists.

Parameters:
dataEntryID - the DataEntry's identifier.
Returns:
the DataEntry matching the given dataEntryID or null, if no such instance exists.

getDataEntry

public DataEntry getDataEntry(ClassMeta classMeta,
                              String objectID)
Get the DataEntry identified by the given type and JDO/JPA-object-ID.

Parameters:
classMeta - reference to the searched DataEntry's classMeta (which must match the searched instance's concrete type - not the root-type of the inheritance tree!).
objectID - the String-representation of the JDO/JPA-object-ID.
Returns:
the DataEntry matching the given combination of classMeta and objectID; or null, if no such instance exists.

getDataEntryID

public Long getDataEntryID(ClassMeta classMeta,
                           String objectID)

Get the dataEntryID of the DataEntry identified by the given type and JDO/JPA-object-ID.

This method is equivalent to first calling

DataEntry e = #getDataEntry(PersistenceManager, ClassMeta, String)

and then

e == null ? null : Long.valueOf(e.getDataEntryID())

but faster, because it does not query unnecessary data from the underlying database.

Parameters:
classMeta - reference to the searched DataEntry's classMeta (which must match the searched instance's concrete type - not the root-type of the inheritance tree!).
objectID - the String-representation of the JDO/JPA-object-ID.
Returns:
the dataEntryID of the DataEntry matching the given combination of classMeta and objectID; or null, if no such instance exists.

getDataEntryIDsNegated

public Set<Long> getDataEntryIDsNegated(ClassMeta classMeta,
                                        String notThisObjectID)

Get the dataEntryIDs of all those DataEntry instances which do not match the given type and JDO/JPA-object-ID.

This method is thus the negation of #getDataEntryID(PersistenceManager, ClassMeta, String).

Parameters:
classMeta - reference to the searched DataEntry's classMeta (which must match the searched instance's concrete type - not the root-type of the inheritance tree!).
notThisObjectID - the String-representation of the JDO/JPA-object-ID, which should be excluded.
Returns:
the dataEntryIDs of those DataEntrys which match the given classMeta but have an object-ID different from the one specified as notThisObjectID.

Cumulus4j API
(1.2.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.