public class OGroup extends Object implements MutableGroup
ODocument
sModifier and Type | Field and Description |
---|---|
protected com.orientechnologies.orient.core.db.record.ODatabaseRecord |
db
The associated database record.
|
protected com.orientechnologies.orient.core.record.impl.ODocument |
document
The document backing the group
|
Constructor and Description |
---|
OGroup(DefinitionGroup definition)
Creates an empty group with an associated definition group.
|
OGroup(Group org)
Copy constructor.
|
OGroup(com.orientechnologies.orient.core.record.impl.ODocument document,
DefinitionGroup definition,
com.orientechnologies.orient.core.db.record.ODatabaseRecord db)
Creates a group based on the given document
|
Modifier and Type | Method and Description |
---|---|
void |
addProperty(QName propertyName,
Object value)
Adds a property value
|
protected void |
addProperty(QName propertyName,
Object value,
com.orientechnologies.orient.core.record.impl.ODocument document)
Adds a property value to a given
ODocument |
protected void |
associatedDbWithThread()
Associate the database with the current thread (if set on the group)
|
com.orientechnologies.orient.core.record.impl.ODocument |
configureDocument(com.orientechnologies.orient.core.db.record.ODatabaseRecord db)
Configure the internal document with the given database and return it
|
protected Object |
convertDocument(Object value,
QName propertyName)
Converts
ODocument s to Instance s but leaves other objects
untouched. |
protected Object |
convertInstance(Object value)
|
protected QName |
decodeProperty(String encodedProperty)
Decode an encoded property name to a qualified name
|
protected String |
encodeProperty(QName propertyName)
Encode a qualified property name to a string
|
com.orientechnologies.orient.core.db.record.ODatabaseRecord |
getDb()
Get the associated database.
|
DefinitionGroup |
getDefinition()
Get the group definition
|
com.orientechnologies.orient.core.record.impl.ODocument |
getDocument()
Get the internal document.
|
Object[] |
getProperty(QName propertyName)
Get the values for the property with the given name.
|
protected Object[] |
getProperty(QName propertyName,
com.orientechnologies.orient.core.record.impl.ODocument document)
Gets a property value from a given
ODocument |
Iterable<QName> |
getPropertyNames()
Get the property names for which any values exist.
|
protected Iterable<QName> |
getPropertyNames(com.orientechnologies.orient.core.record.impl.ODocument document)
Returns the index keys of a certain ODocument
|
protected Collection<String> |
getSpecialFieldNames()
Get the special field names, e.g.
|
void |
setProperty(QName propertyName,
Object... values)
Sets values for a property
|
protected void |
setPropertyInternal(com.orientechnologies.orient.core.record.impl.ODocument document,
QName propertyName,
Object... values)
Sets values for a property in a certain ODocument
|
protected final com.orientechnologies.orient.core.record.impl.ODocument document
protected com.orientechnologies.orient.core.db.record.ODatabaseRecord db
public OGroup(DefinitionGroup definition)
definition
- the associated grouppublic OGroup(com.orientechnologies.orient.core.record.impl.ODocument document, DefinitionGroup definition, com.orientechnologies.orient.core.db.record.ODatabaseRecord db)
document
- the documentdefinition
- the definition of the associated groupdb
- the databasepublic OGroup(Group org)
org
- the instance to copypublic com.orientechnologies.orient.core.record.impl.ODocument configureDocument(com.orientechnologies.orient.core.db.record.ODatabaseRecord db)
db
- the databasepublic com.orientechnologies.orient.core.record.impl.ODocument getDocument()
public void addProperty(QName propertyName, Object value)
MutableGroup
addProperty
in interface MutableGroup
propertyName
- the property namevalue
- the property valueMutableGroup.addProperty(QName, Object)
protected void addProperty(QName propertyName, Object value, com.orientechnologies.orient.core.record.impl.ODocument document)
ODocument
propertyName
- the property namevalue
- the property valuedocument
- the {link ODocument} where the value is to addprotected Object convertInstance(Object value)
value
- the object to convertpublic void setProperty(QName propertyName, Object... values)
MutableGroup
setProperty
in interface MutableGroup
propertyName
- the property namevalues
- the values for the propertyMutableGroup.setProperty(QName, Object[])
protected void setPropertyInternal(com.orientechnologies.orient.core.record.impl.ODocument document, QName propertyName, Object... values)
propertyName
- the property namevalues
- the values for the propertydocument
- the document which should contain the dataprotected String encodeProperty(QName propertyName)
propertyName
- the qualified property nameprotected QName decodeProperty(String encodedProperty)
encodedProperty
- the encoded property namepublic Object[] getProperty(QName propertyName)
Group
getProperty
in interface Group
propertyName
- the property namenull
if none existGroup.getProperty(QName)
protected Object[] getProperty(QName propertyName, com.orientechnologies.orient.core.record.impl.ODocument document)
ODocument
propertyName
- the property namedocument
- the {link ODocument} which contains the propertyprotected void associatedDbWithThread()
protected Object convertDocument(Object value, QName propertyName)
ODocument
s to Instance
s but leaves other objects
untouched.value
- the object to convertpropertyName
- the name of the property the value is associated withpublic Iterable<QName> getPropertyNames()
Group
getPropertyNames
in interface Group
Group.getPropertyNames()
protected Iterable<QName> getPropertyNames(com.orientechnologies.orient.core.record.impl.ODocument document)
document
- the keys are retrieved fromprotected Collection<String> getSpecialFieldNames()
public DefinitionGroup getDefinition()
Group
getDefinition
in interface Group
Group.getDefinition()
public com.orientechnologies.orient.core.db.record.ODatabaseRecord getDb()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a