|
Cumulus4j API (1.0.2) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cumulus4j.store.model.DataEntry
public class DataEntry
Persistent container holding an entity's data in encrypted form.
| Constructor Summary | |
|---|---|
protected |
DataEntry()
Internal constructor. |
|
DataEntry(ClassMeta classMeta,
String objectID)
Create an instance of DataEntry. |
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
ClassMeta |
getClassMeta()
Get the type of the entity persisted in this container. |
static DataEntry |
getDataEntry(PersistenceManager pmData,
ClassMeta classMeta,
String objectID)
Get the DataEntry identified by the given type and JDO/JPA-object-ID. |
static DataEntry |
getDataEntry(PersistenceManager pmData,
long dataEntryID)
Get the DataEntry identified by the specified dataEntryID or
null if no such instance exists. |
long |
getDataEntryID()
Get the single primary key field (= object-identifier) of DataEntry. |
static Long |
getDataEntryID(PersistenceManager pmData,
ClassMeta classMeta,
String objectID)
Get the dataEntryID of the DataEntry identified by the
given type and JDO/JPA-object-ID. |
static Set<Long> |
getDataEntryIDsNegated(PersistenceManager pmData,
ClassMeta classMeta,
String notThisObjectID)
Get the dataEntryIDs of all those DataEntry instances
which do not match the given type and JDO/JPA-object-ID. |
long |
getKeyID()
Get the identifier of the encryption-key used to encrypt the value. |
String |
getObjectID()
Get the String-representation of the entity's identifier. |
byte[] |
getValue()
Get the encrypted data of an entity. |
int |
hashCode()
|
void |
jdoPreStore()
|
void |
setKeyID(long keyID)
Set the identifier of the encryption-key used to encrypt the value. |
void |
setValue(byte[] value)
Set the encrypted data of an entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DataEntry()
public DataEntry(ClassMeta classMeta,
String objectID)
DataEntry.
classMeta - the type of the entity persisted in this container (which must be the entity's concrete type -
not the root-type of the inheritance tree!). See getClassMeta() for further details.objectID - the String-representation of the entity's identifier (aka OID or object-ID).
See getObjectID() for further details.| Method Detail |
|---|
public static DataEntry getDataEntry(PersistenceManager pmData,
long dataEntryID)
DataEntry identified by the specified dataEntryID or
null if no such instance exists.
pmData - the backend-PersistenceManager. Must not be null.dataEntryID - the DataEntry's identifier.
DataEntry matching the given dataEntryID or null, if no such instance exists.
public static DataEntry getDataEntry(PersistenceManager pmData,
ClassMeta classMeta,
String objectID)
DataEntry identified by the given type and JDO/JPA-object-ID.
pmData - the backend-PersistenceManager. Must not be null.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.
DataEntry matching the given combination of classMeta and objectID;
or null, if no such instance exists.
public static Long getDataEntryID(PersistenceManager pmData,
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.
pmData - the backend-PersistenceManager. Must not be null.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.
dataEntryID of the DataEntry matching the
given combination of classMeta and objectID;
or null, if no such instance exists.
public static Set<Long> getDataEntryIDsNegated(PersistenceManager pmData,
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).
pmData - the backend-PersistenceManager. Must not be null.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.
dataEntryIDs of those DataEntrys which match the given
classMeta but have an object-ID different from the one specified as notThisObjectID.public long getDataEntryID()
DataEntry.
public ClassMeta getClassMeta()
Get the type of the entity persisted in this container.
Note, that this is the concrete type of the persisted object and not the root-type of the
persistable hierarchy. For example, if bbb is persisted and bbb is an instance of
class BBB which extends AAA
and both classes are persistable, this will point to class BBB (and not AAA).
Therefore, if you want to query all instances of a certain type including subclasses, you have to
ask for the sub-classes via StoreManager.getSubClassesForClass(String, boolean, org.datanucleus.ClassLoaderResolver)
first and then query for all these classes individually.
public String getObjectID()
Get the String-representation of the entity's identifier.
For JDO, please read the following (and related) documentation:
For JPA, please read the following (and related) documentation:
JDOHelper.getObjectId(entity).toString()
when using JDO).public long getKeyID()
value.
DataEntry's contents.setKeyID(long)public void setKeyID(long keyID)
value.
keyID - the encryption-key used to encrypt this DataEntry's contents.getKeyID()public byte[] getValue()
ObjectContainer
which is then serialised using Java native serialisation and finally encrypted.
ObjectContainer holding the entity's data.setValue(byte[])public void setValue(byte[] value)
value - the encrypted serialised data of an ObjectContainer holding the entity's data.getValue()public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic void jdoPreStore()
jdoPreStore in interface StoreCallback
|
Cumulus4j API (1.0.2) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||