
public class OClassImpl extends ODocumentWrapperNoClass implements OClass
OClass.ATTRIBUTES, OClass.INDEX_TYPEdocumentEDGE_CLASS_NAME, VERTEX_CLASS_NAME| Modifier | Constructor and Description |
|---|---|
protected |
OClassImpl(OSchemaShared iOwner,
ODocument iDocument,
String iName)
Constructor used in unmarshalling.
|
protected |
OClassImpl(OSchemaShared iOwner,
String iName)
Constructor used in unmarshalling.
|
protected |
OClassImpl(OSchemaShared iOwner,
String iName,
int[] iClusterIds) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireSchemaReadLock() |
void |
acquireSchemaWriteLock() |
OClass |
addCluster(String clusterNameOrId) |
OClass |
addClusterId(int clusterId) |
static OClass |
addClusters(OClass cls,
int iClusters) |
OPropertyImpl |
addPropertyInternal(String name,
OType type,
OType linkedType,
OClass linkedClass,
boolean unsafe) |
OClass |
addSuperClass(OClass superClass) |
boolean |
areIndexed(Collection<String> fields)
Indicates whether given fields are contained as first key fields in class indexes.
|
boolean |
areIndexed(String... fields) |
void |
checkEmbedded() |
protected static void |
checkParametersConflict(List<OClass> classes) |
void |
checkPersistentPropertyType(ODatabaseInternal<ORecord> database,
String propertyName,
OType type) |
void |
clearCustom() |
int |
compareTo(OClass o) |
long |
count()
Returns the number of the records of this class considering also subclasses (polymorphic).
|
long |
count(boolean isPolymorphic)
Returns the number of the records of this class and based on polymorphic parameter it consider or not the subclasses.
|
OIndex<?> |
createIndex(String iName,
OClass.INDEX_TYPE iType,
OProgressListener iProgressListener,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String iName,
OClass.INDEX_TYPE iType,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String iName,
String iType,
OProgressListener iProgressListener,
ODocument metadata,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String name,
String type,
OProgressListener progressListener,
ODocument metadata,
String algorithm,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String iName,
String iType,
String... fields)
Creates database index that is based on passed in field names.
|
OProperty |
createProperty(String iPropertyName,
OType iType) |
OProperty |
createProperty(String iPropertyName,
OType iType,
OClass iLinkedClass) |
OProperty |
createProperty(String iPropertyName,
OType iType,
OClass iLinkedClass,
boolean unsafe)
Create a property in the class with the specified options.
|
OProperty |
createProperty(String iPropertyName,
OType iType,
OType iLinkedType) |
OProperty |
createProperty(String iPropertyName,
OType iType,
OType iLinkedType,
boolean unsafe)
Create a property in the class with the specified options.
|
Collection<OProperty> |
declaredProperties() |
static String |
decodeClassName(String s) |
void |
dropProperty(String propertyName) |
boolean |
equals(Object obj) |
boolean |
existsProperty(String propertyName) |
List<OType> |
extractFieldTypes(String[] fieldNames) |
void |
fireDatabaseMigration(ODatabaseDocument database,
String propertyName,
OType type) |
void |
firePropertyNameMigration(ODatabaseDocument database,
String propertyName,
String newPropertyName,
OType type) |
void |
fromStream() |
Object |
get(OClass.ATTRIBUTES iAttribute) |
Collection<OClass> |
getAllBaseClasses() |
Collection<OClass> |
getAllSubclasses() |
Collection<OClass> |
getAllSuperClasses() |
OIndex<?> |
getAutoShardingIndex()
Returns the auto sharding index configured for the class if any.
|
Collection<OClass> |
getBaseClasses() |
OIndex<?> |
getClassIndex(String name)
Returns index instance by database index name.
|
Set<OIndex<?>> |
getClassIndexes() |
void |
getClassIndexes(Collection<OIndex<?>> indexes)
Internal.
|
Set<OIndex<?>> |
getClassInvolvedIndexes(Collection<String> fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
Set<OIndex<?>> |
getClassInvolvedIndexes(String... fields) |
float |
getClassOverSize() |
int |
getClusterForNewInstance(ODocument doc) |
int[] |
getClusterIds() |
OClusterSelectionStrategy |
getClusterSelection() |
String |
getCustom(String iName) |
Map<String,String> |
getCustomInternal() |
Set<String> |
getCustomKeys() |
int |
getDefaultClusterId() |
String |
getDescription() |
protected String |
getEscapedName(String iName,
boolean iStrictSQL) |
Collection<OProperty> |
getIndexedProperties() |
void |
getIndexedProperties(Collection<OProperty> indexedProperties) |
Set<OIndex<?>> |
getIndexes() |
void |
getIndexes(Collection<OIndex<?>> indexes)
Internal.
|
Set<OIndex<?>> |
getInvolvedIndexes(Collection<String> fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
Set<OIndex<?>> |
getInvolvedIndexes(String... fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
String |
getName() |
float |
getOverSize()
Returns the oversize factor.
|
OSchemaShared |
getOwner() |
int[] |
getPolymorphicClusterIds() |
OProperty |
getProperty(String propertyName) |
String |
getShortName() |
long |
getSize() |
String |
getStreamableName() |
Collection<OClass> |
getSubclasses() |
OClass |
getSuperClass() |
List<OClass> |
getSuperClasses() |
List<String> |
getSuperClassesNames() |
boolean |
hasClusterId(int clusterId) |
int |
hashCode() |
boolean |
hasPolymorphicClusterId(int clusterId) |
boolean |
hasSuperClasses() |
boolean |
isAbstract() |
boolean |
isEdgeType() |
boolean |
isStrictMode() |
boolean |
isSubClassOf(OClass clazz)
Check if the current instance extends specified schema class.
|
boolean |
isSubClassOf(String iClassName)
Check if the current instance extends specified schema class.
|
boolean |
isSuperClassOf(OClass clazz)
Returns true if the passed schema class (iClass) extends the current instance.
|
boolean |
isVertexType() |
void |
onPostIndexManagement() |
Collection<OProperty> |
properties() |
Map<String,OProperty> |
propertiesMap() |
static int[] |
readableClusters(ODatabaseDocument iDatabase,
int[] iClusterIds) |
void |
releaseSchemaReadLock() |
void |
releaseSchemaWriteLock() |
void |
releaseSchemaWriteLock(boolean iSave) |
<RET extends ODocumentWrapper> |
reload() |
OClass |
removeClusterId(int clusterId) |
void |
removeCustom(String name) |
OClass |
removeSuperClass(OClass superClass) |
void |
renameProperty(String iOldName,
String iNewName) |
OClass |
set(OClass.ATTRIBUTES attribute,
Object iValue) |
OClass |
setAbstract(boolean isAbstract) |
OClass |
setClusterSelection(OClusterSelectionStrategy clusterSelection) |
OClass |
setClusterSelection(String value) |
void |
setClusterSelectionInternal(OClusterSelectionStrategy iClusterSelection) |
void |
setClusterSelectionInternal(String clusterSelection) |
OClassImpl |
setCustom(String name,
String value) |
void |
setDefaultClusterId(int defaultClusterId) |
OClass |
setDescription(String iDescription) |
OClassImpl |
setEncryption(String iValue) |
protected void |
setEncryptionInternal(String iValue) |
OClass |
setName(String name) |
OClass |
setOverSize(float overSize)
Sets the oversize factor.
|
OClass |
setShortName(String shortName) |
OClass |
setStrictMode(boolean isStrict) |
OClass |
setSuperClass(OClass iSuperClass) |
OClass |
setSuperClasses(List<? extends OClass> classes) |
OClass |
setSuperClassesByNames(List<String> classNames) |
ODocument |
toStream() |
String |
toString() |
void |
truncate()
Truncates all the clusters the class uses.
|
OClass |
truncateCluster(String clusterName)
Removes all data in the cluster with given name.
|
fromStream, load, load, reload, save, savegetDocument, load, load, reloadprotected OClassImpl(OSchemaShared iOwner, String iName)
protected OClassImpl(OSchemaShared iOwner, String iName, int[] iClusterIds)
protected OClassImpl(OSchemaShared iOwner, ODocument iDocument, String iName)
public static int[] readableClusters(ODatabaseDocument iDatabase, int[] iClusterIds)
public OClusterSelectionStrategy getClusterSelection()
getClusterSelection in interface OClasspublic OClass setClusterSelection(OClusterSelectionStrategy clusterSelection)
setClusterSelection in interface OClasspublic OClass setClusterSelection(String value)
setClusterSelection in interface OClasspublic <RET extends ODocumentWrapper> RET reload()
reload in class ODocumentWrapperNoClasspublic OClassImpl setCustom(String name, String value)
public void removeCustom(String name)
removeCustom in interface OClasspublic void clearCustom()
clearCustom in interface OClasspublic Set<String> getCustomKeys()
getCustomKeys in interface OClasspublic boolean hasClusterId(int clusterId)
hasClusterId in interface OClasspublic boolean hasPolymorphicClusterId(int clusterId)
hasPolymorphicClusterId in interface OClasspublic OClass getSuperClass()
getSuperClass in interface OClasspublic OClass setSuperClass(OClass iSuperClass)
setSuperClass in interface OClasspublic List<OClass> getSuperClasses()
getSuperClasses in interface OClasspublic boolean hasSuperClasses()
hasSuperClasses in interface OClasspublic List<String> getSuperClassesNames()
getSuperClassesNames in interface OClasspublic OClass setSuperClasses(List<? extends OClass> classes)
setSuperClasses in interface OClasspublic OClass addSuperClass(OClass superClass)
addSuperClass in interface OClasspublic OClass removeSuperClass(OClass superClass)
removeSuperClass in interface OClasspublic String getShortName()
getShortName in interface OClasspublic OClass setShortName(String shortName)
setShortName in interface OClasspublic String getDescription()
getDescription in interface OClasspublic OClass setDescription(String iDescription)
setDescription in interface OClasspublic String getStreamableName()
getStreamableName in interface OClasspublic Collection<OProperty> declaredProperties()
declaredProperties in interface OClasspublic Map<String,OProperty> propertiesMap()
propertiesMap in interface OClasspublic Collection<OProperty> properties()
properties in interface OClasspublic void getIndexedProperties(Collection<OProperty> indexedProperties)
public Collection<OProperty> getIndexedProperties()
getIndexedProperties in interface OClasspublic OProperty getProperty(String propertyName)
getProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType)
createProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType, OClass iLinkedClass)
createProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType, OClass iLinkedClass, boolean unsafe)
OClasscreateProperty in interface OClassiPropertyName - the name of the property.iType - the type of the property.iLinkedClass - in case of property of type LINK,LINKLIST,LINKSET,LINKMAP,EMBEDDED,EMBEDDEDLIST,EMBEDDEDSET,EMBEDDEDMAP can be
specified a linked class in all the other cases should be nullunsafe - if true avoid to check the persistent data for compatibility, should be used only if all persistent data is compatible
with the propertypublic OProperty createProperty(String iPropertyName, OType iType, OType iLinkedType)
createProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType, OType iLinkedType, boolean unsafe)
OClasscreateProperty in interface OClassiPropertyName - the name of the property.iType - the type of the property.iLinkedType - in case of property of type EMBEDDEDLIST,EMBEDDEDSET,EMBEDDEDMAP can be specified a linked type in all the other cases
should be nullunsafe - if true avoid to check the persistent data for compatibility, should be used only if all persistent data is compatible
with the propertypublic boolean existsProperty(String propertyName)
existsProperty in interface OClasspublic void dropProperty(String propertyName)
dropProperty in interface OClasspublic void fromStream()
fromStream in class ODocumentWrapperNoClass@OBeforeSerialization public ODocument toStream()
toStream in class ODocumentWrapperpublic int getClusterForNewInstance(ODocument doc)
getClusterForNewInstance in interface OClasspublic int getDefaultClusterId()
getDefaultClusterId in interface OClasspublic void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId in interface OClasspublic int[] getClusterIds()
getClusterIds in interface OClasspublic int[] getPolymorphicClusterIds()
getPolymorphicClusterIds in interface OClasspublic OClass addClusterId(int clusterId)
addClusterId in interface OClasspublic OClass addCluster(String clusterNameOrId)
addCluster in interface OClasspublic OClass truncateCluster(String clusterName)
truncateCluster in interface OClassclusterName - Name of cluster to be truncated.public OClass removeClusterId(int clusterId)
removeClusterId in interface OClasspublic Collection<OClass> getSubclasses()
getSubclasses in interface OClasspublic Collection<OClass> getAllSubclasses()
getAllSubclasses in interface OClasspublic Collection<OClass> getBaseClasses()
getBaseClasses in interface OClasspublic Collection<OClass> getAllBaseClasses()
getAllBaseClasses in interface OClasspublic Collection<OClass> getAllSuperClasses()
getAllSuperClasses in interface OClasspublic float getOverSize()
OClassgetOverSize in interface OClassOClass.setOverSize(float)public OClass setOverSize(float overSize)
OClasssetOverSize in interface OClassOClass.getOverSize()public float getClassOverSize()
getClassOverSize in interface OClasspublic boolean isAbstract()
isAbstract in interface OClasspublic OClass setAbstract(boolean isAbstract)
setAbstract in interface OClasspublic boolean isStrictMode()
isStrictMode in interface OClasspublic OClass setStrictMode(boolean isStrict)
setStrictMode in interface OClasspublic String toString()
toString in class ODocumentWrapperpublic boolean equals(Object obj)
equals in class ODocumentWrapperpublic int hashCode()
hashCode in class ODocumentWrapperpublic int compareTo(OClass o)
compareTo in interface Comparable<OClass>public long count()
OClasspublic long count(boolean isPolymorphic)
OClasspublic void truncate()
throws IOException
truncate in interface OClassIOExceptionpublic boolean isSubClassOf(String iClassName)
isSubClassOf in interface OClassiClassName - of class that should be checkedisSuperClassOf(OClass)public boolean isSubClassOf(OClass clazz)
isSubClassOf in interface OClassclazz - to checkisSuperClassOf(OClass)public boolean isSuperClassOf(OClass clazz)
isSuperClassOf in interface OClassclazz - to checkisSubClassOf(OClass)public Object get(OClass.ATTRIBUTES iAttribute)
public OClass set(OClass.ATTRIBUTES attribute, Object iValue)
public OClassImpl setEncryption(String iValue)
protected void setEncryptionInternal(String iValue)
public OPropertyImpl addPropertyInternal(String name, OType type, OType linkedType, OClass linkedClass, boolean unsafe)
public OIndex<?> createIndex(String iName, OClass.INDEX_TYPE iType, String... fields)
OClasscreateIndex in interface OClassiName - Database index nameiType - Index type.fields - Field names from which index will be created.public OIndex<?> createIndex(String iName, String iType, String... fields)
OClasscreateIndex in interface OClassiName - Database index nameiType - Index type.fields - Field names from which index will be created.public OIndex<?> createIndex(String iName, OClass.INDEX_TYPE iType, OProgressListener iProgressListener, String... fields)
OClasscreateIndex in interface OClassiName - Database index name.iType - Index type.iProgressListener - Progress listener.fields - Field names from which index will be created.public OIndex<?> createIndex(String iName, String iType, OProgressListener iProgressListener, ODocument metadata, String... fields)
OClasscreateIndex in interface OClassiName - Database index name.iType - Index type.iProgressListener - Progress listener.metadata - Additional parameters which will be added in index configuration document as "metadata" field.fields - Field names from which index will be created. @return Class index registered inside of given class ans associated with
database index.public OIndex<?> createIndex(String name, String type, OProgressListener progressListener, ODocument metadata, String algorithm, String... fields)
OClasscreateIndex in interface OClassname - Database index name.type - Index type.progressListener - Progress listener.metadata - Additional parameters which will be added in index configuration document as "metadata" field.algorithm - Algorithm to use for indexing.fields - Field names from which index will be created. @return Class index registered inside of given class ans associated with
database index.public boolean areIndexed(String... fields)
areIndexed in interface OClassfields - Field names.true if given fields are contained as first key fields in class indexes.OClass.areIndexed(java.util.Collection)public boolean areIndexed(Collection<String> fields)
OClassareIndexed in interface OClassfields - Field names.true if given fields are contained as first key fields in class indexes.public Set<OIndex<?>> getInvolvedIndexes(String... fields)
OClassAll indexes sorted by their count of parameters in ascending order. If there are indexes for the given set of fields in super class they will be taken into account.
getInvolvedIndexes in interface OClassfields - Field names.OClass.getInvolvedIndexes(java.util.Collection)public Set<OIndex<?>> getInvolvedIndexes(Collection<String> fields)
OClassAll indexes sorted by their count of parameters in ascending order. If there are indexes for the given set of fields in super class they will be taken into account.
getInvolvedIndexes in interface OClassfields - Field names.OIndexDefinition.getParamCount()public Set<OIndex<?>> getClassInvolvedIndexes(Collection<String> fields)
OClassIndexes that related only to the given class will be returned.
getClassInvolvedIndexes in interface OClassfields - Field names.OIndexDefinition.getParamCount()public Set<OIndex<?>> getClassInvolvedIndexes(String... fields)
getClassInvolvedIndexes in interface OClassfields - Field names.OClass.getClassInvolvedIndexes(java.util.Collection)public OIndex<?> getClassIndex(String name)
OClassgetClassIndex in interface OClassname - Database index name.public Set<OIndex<?>> getClassIndexes()
getClassIndexes in interface OClasspublic void getClassIndexes(Collection<OIndex<?>> indexes)
OClassgetClassIndexes in interface OClasspublic OIndex<?> getAutoShardingIndex()
OClassgetAutoShardingIndex in interface OClasspublic boolean isEdgeType()
isEdgeType in interface OClasspublic boolean isVertexType()
isVertexType in interface OClasspublic void onPostIndexManagement()
public void getIndexes(Collection<OIndex<?>> indexes)
OClassgetIndexes in interface OClasspublic Set<OIndex<?>> getIndexes()
getIndexes in interface OClasspublic void acquireSchemaReadLock()
public void releaseSchemaReadLock()
public void acquireSchemaWriteLock()
public void releaseSchemaWriteLock()
public void releaseSchemaWriteLock(boolean iSave)
public void checkEmbedded()
public void setClusterSelectionInternal(String clusterSelection)
public void setClusterSelectionInternal(OClusterSelectionStrategy iClusterSelection)
public void fireDatabaseMigration(ODatabaseDocument database, String propertyName, OType type)
public void firePropertyNameMigration(ODatabaseDocument database, String propertyName, String newPropertyName, OType type)
public void checkPersistentPropertyType(ODatabaseInternal<ORecord> database, String propertyName, OType type)
public OSchemaShared getOwner()
Copyright © 2009–2025 OrientDB. All rights reserved.