Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.instance.orient.storage
Class OrientInstanceReference

java.lang.Object
  extended by eu.esdihumboldt.hale.common.instance.orient.storage.OrientInstanceReference
All Implemented Interfaces:
InstanceReference

@Immutable
public class OrientInstanceReference
extends Object
implements InstanceReference

Instance reference for an instance stored in a LocalOrientDB.

Author:
Simon Templer

Constructor Summary
OrientInstanceReference(com.orientechnologies.orient.core.id.ORID id, DataSet dataSet, TypeDefinition typeDefinition)
          Create a reference to an instance
 
Method Summary
static InstanceReference createReference(Instance instance)
          Create a reference for an instance
 boolean equals(Object obj)
           
 DataSet getDataSet()
          Get the data set the instance is associated to.
 com.orientechnologies.orient.core.id.ORID getId()
           
 TypeDefinition getTypeDefinition()
           
 int hashCode()
           
 Instance load(LocalOrientDB lodb)
          Load the instance specified by the reference from the given database.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrientInstanceReference

public OrientInstanceReference(com.orientechnologies.orient.core.id.ORID id,
                               DataSet dataSet,
                               TypeDefinition typeDefinition)
Create a reference to an instance

Parameters:
id - the record ID
dataSet - the data set
typeDefinition - the associated type definition
Method Detail

getId

public com.orientechnologies.orient.core.id.ORID getId()
Returns:
the id

getDataSet

public DataSet getDataSet()
Description copied from interface: InstanceReference
Get the data set the instance is associated to.

Specified by:
getDataSet in interface InstanceReference
Returns:
the instance data set, null if not set

getTypeDefinition

public TypeDefinition getTypeDefinition()
Returns:
the typeDefinition

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

createReference

public static InstanceReference createReference(Instance instance)
Create a reference for an instance

Parameters:
instance - the instance, which must be an OInstance
Returns:
the instance reference
Throws:
IllegalArgumentException - if the instance is no OInstance

load

public Instance load(LocalOrientDB lodb)
Load the instance specified by the reference from the given database.

Parameters:
lodb - the database
Returns:
the instance or null if no instance matching the reference is present

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d