
public class OImmutableClass extends Object implements OClass
OClass.ATTRIBUTES, OClass.INDEX_TYPE| Modifier and Type | Field and Description |
|---|---|
static String |
EDGE_CLASS_NAME
Deprecated.
|
static String |
VERTEX_CLASS_NAME
Deprecated.
|
| Constructor and Description |
|---|
OImmutableClass(OClass oClass,
OImmutableSchema schema) |
| Modifier and Type | Method and Description |
|---|---|
OClass |
addCluster(String iClusterName) |
OClass |
addClusterId(int iId) |
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 |
clearCustom() |
int |
compareTo(OClass other) |
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 iName,
String iType,
OProgressListener iProgressListener,
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() |
void |
dropProperty(String iPropertyName) |
boolean |
equals(Object obj) |
boolean |
existsProperty(String propertyName) |
Object |
get(OClass.ATTRIBUTES iAttribute) |
Collection<OClass> |
getAllBaseClasses()
Deprecated.
|
Collection<OClass> |
getAllSubclasses() |
Collection<OClass> |
getAllSuperClasses() |
OIndex<?> |
getAutoShardingIndex()
Returns the auto sharding index configured for the class if any.
|
Collection<OClass> |
getBaseClasses()
Deprecated.
|
OIndex<?> |
getClassIndex(String iName)
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) |
Set<String> |
getCustomKeys() |
int |
getDefaultClusterId() |
String |
getDescription() |
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.
|
int[] |
getPolymorphicClusterIds() |
OProperty |
getProperty(String propertyName) |
void |
getRawClassIndexes(Collection<OIndex<?>> indexes) |
Set<OIndex<?>> |
getRawIndexes() |
void |
getRawIndexes(Collection<OIndex<?>> indexes) |
OImmutableSchema |
getSchema() |
String |
getShortName() |
long |
getSize() |
String |
getStreamableName() |
Collection<OClass> |
getSubclasses() |
OClass |
getSuperClass()
Deprecated.
|
List<OClass> |
getSuperClasses() |
List<String> |
getSuperClassesNames() |
boolean |
hasClusterId(int clusterId) |
int |
hashCode() |
boolean |
hasPolymorphicClusterId(int clusterId) |
boolean |
hasSuperClasses() |
void |
init() |
boolean |
isAbstract() |
boolean |
isEdgeType() |
boolean |
isFunction() |
boolean |
isOrole() |
boolean |
isOuser() |
boolean |
isRestricted() |
boolean |
isScheduler() |
boolean |
isSequence() |
boolean |
isStrictMode() |
boolean |
isSubClassOf(OClass clazz)
Returns true if the current instance extends the passed schema class (iClass).
|
boolean |
isSubClassOf(String iClassName)
Tells if the current instance extends the passed schema class (iClass).
|
boolean |
isSuperClassOf(OClass clazz)
Returns true if the passed schema class (iClass) extends the current instance.
|
boolean |
isTriggered() |
boolean |
isVertexType() |
Collection<OProperty> |
properties() |
Map<String,OProperty> |
propertiesMap() |
OClass |
removeClusterId(int iId) |
void |
removeCustom(String iName) |
OClass |
removeSuperClass(OClass superClass) |
OClass |
set(OClass.ATTRIBUTES attribute,
Object iValue) |
OClass |
setAbstract(boolean iAbstract) |
OClass |
setClusterSelection(OClusterSelectionStrategy clusterSelection) |
OClass |
setClusterSelection(String iStrategyName) |
OClass |
setCustom(String iName,
String iValue) |
void |
setDefaultClusterId(int iDefaultClusterId) |
OClass |
setDescription(String iDescription) |
OClass |
setName(String iName) |
OClass |
setOverSize(float overSize)
Sets the oversize factor.
|
OClass |
setShortName(String shortName) |
OClass |
setStrictMode(boolean iMode) |
OClass |
setSuperClass(OClass iSuperClass)
Deprecated.
|
OClass |
setSuperClasses(List<? extends OClass> classes) |
String |
toString() |
void |
truncate()
Truncates all the clusters the class uses.
|
OClass |
truncateCluster(String clusterName)
Removes all data in the cluster with given name.
|
@Deprecated public static final String EDGE_CLASS_NAME
@Deprecated public static final String VERTEX_CLASS_NAME
public OImmutableClass(OClass oClass, OImmutableSchema schema)
public void init()
public boolean isAbstract()
isAbstract in interface OClasspublic OClass setAbstract(boolean iAbstract)
setAbstract in interface OClasspublic boolean isStrictMode()
isStrictMode in interface OClasspublic OClass setStrictMode(boolean iMode)
setStrictMode in interface OClass@Deprecated public OClass getSuperClass()
getSuperClass in interface OClass@Deprecated public 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 getStreamableName()
getStreamableName in interface OClasspublic Collection<OProperty> declaredProperties()
declaredProperties in interface OClasspublic Collection<OProperty> properties()
properties in interface OClasspublic Map<String,OProperty> propertiesMap()
propertiesMap 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 void dropProperty(String iPropertyName)
dropProperty in interface OClasspublic boolean existsProperty(String propertyName)
existsProperty in interface OClasspublic int getClusterForNewInstance(ODocument doc)
getClusterForNewInstance in interface OClasspublic int getDefaultClusterId()
getDefaultClusterId in interface OClasspublic void setDefaultClusterId(int iDefaultClusterId)
setDefaultClusterId in interface OClasspublic int[] getClusterIds()
getClusterIds in interface OClasspublic OClass addClusterId(int iId)
addClusterId in interface OClasspublic OClusterSelectionStrategy getClusterSelection()
getClusterSelection in interface OClasspublic OClass setClusterSelection(OClusterSelectionStrategy clusterSelection)
setClusterSelection in interface OClasspublic OClass setClusterSelection(String iStrategyName)
setClusterSelection in interface OClasspublic OClass addCluster(String iClusterName)
addCluster in interface OClasspublic OClass truncateCluster(String clusterName)
OClasstruncateCluster in interface OClassclusterName - Name of cluster to be truncated.public OClass removeClusterId(int iId)
removeClusterId in interface OClasspublic int[] getPolymorphicClusterIds()
getPolymorphicClusterIds in interface OClasspublic OImmutableSchema getSchema()
public Collection<OClass> getSubclasses()
getSubclasses in interface OClasspublic Collection<OClass> getAllSubclasses()
getAllSubclasses in interface OClass@Deprecated public Collection<OClass> getBaseClasses()
getBaseClasses in interface OClass@Deprecated public Collection<OClass> getAllBaseClasses()
getAllBaseClasses in interface OClasspublic Collection<OClass> getAllSuperClasses()
getAllSuperClasses in interface OClasspublic float getOverSize()
OClassgetOverSize in interface OClassOClass.setOverSize(float)public float getClassOverSize()
getClassOverSize in interface OClasspublic OClass setOverSize(float overSize)
OClasssetOverSize in interface OClassOClass.getOverSize()public long count()
OClasspublic long count(boolean isPolymorphic)
OClasspublic void truncate()
throws IOException
OClasstruncate in interface OClassIOExceptionpublic boolean isSubClassOf(String iClassName)
OClassisSubClassOf in interface OClassOClass.isSuperClassOf(OClass)public boolean isSubClassOf(OClass clazz)
OClassisSubClassOf in interface OClassOClass.isSuperClassOf(OClass)public boolean isSuperClassOf(OClass clazz)
OClassisSuperClassOf in interface OClassOClass.isSubClassOf(OClass)public 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 Object get(OClass.ATTRIBUTES iAttribute)
public OClass set(OClass.ATTRIBUTES attribute, Object iValue)
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 algorithm, 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.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 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 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<?>> 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<?>> 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 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 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 OIndex<?> getClassIndex(String iName)
OClassgetClassIndex in interface OClassiName - Database index name.public Set<OIndex<?>> getClassIndexes()
getClassIndexes in interface OClasspublic void getClassIndexes(Collection<OIndex<?>> indexes)
OClassgetClassIndexes in interface OClasspublic void getRawClassIndexes(Collection<OIndex<?>> indexes)
public void getIndexes(Collection<OIndex<?>> indexes)
OClassgetIndexes in interface OClasspublic void getRawIndexes(Collection<OIndex<?>> indexes)
public Set<OIndex<?>> getIndexes()
getIndexes in interface OClasspublic OIndex<?> getAutoShardingIndex()
OClassgetAutoShardingIndex in interface OClasspublic void removeCustom(String iName)
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 int compareTo(OClass other)
compareTo in interface Comparable<OClass>public boolean isRestricted()
public boolean isEdgeType()
isEdgeType in interface OClasspublic boolean isVertexType()
isVertexType in interface OClasspublic boolean isTriggered()
public boolean isFunction()
public boolean isScheduler()
public boolean isOuser()
public boolean isOrole()
public boolean isSequence()
Copyright © 2009–2025 OrientDB. All rights reserved.