java.lang.Object
com.orientechnologies.orient.core.metadata.schema.OPropertyImpl
All Implemented Interfaces:
OProperty, Comparable<OProperty>
Direct Known Subclasses:
OPropertyEmbedded, OPropertyRemote

public abstract class OPropertyImpl extends Object implements OProperty
Contains the description of a persistent class property.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Field Details

    • owner

      protected final OClassImpl owner
    • linkedType

      protected OType linkedType
    • linkedClass

      protected OClass linkedClass
    • linkedClassName

      protected transient String linkedClassName
    • description

      protected String description
    • mandatory

      protected boolean mandatory
    • notNull

      protected boolean notNull
    • min

      protected String min
    • max

      protected String max
    • defaultValue

      protected String defaultValue
    • regexp

      protected String regexp
    • readonly

      protected boolean readonly
    • customFields

      protected Map<String,String> customFields
    • collate

      protected OCollate collate
    • globalRef

      protected OGlobalProperty globalRef
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface OProperty
    • getFullName

      public String getFullName()
      Description copied from interface: OProperty
      Returns the full name as .
      Specified by:
      getFullName in interface OProperty
    • getFullNameQuoted

      public String getFullNameQuoted()
    • getType

      public OType getType()
      Specified by:
      getType in interface OProperty
    • compareTo

      public int compareTo(OProperty o)
      Specified by:
      compareTo in interface Comparable<OProperty>
    • createIndex

      public OIndex createIndex(OClass.INDEX_TYPE iType)
      Creates an index on this property. Indexes speed up queries but slow down insert and update operations. For massive inserts we suggest to remove the index, make the massive insert and recreate it.
      Specified by:
      createIndex in interface OProperty
      Parameters:
      iType - One of types supported.
      • UNIQUE: Doesn't allow duplicates
      • NOTUNIQUE: Allow duplicates
      • FULLTEXT: Indexes single word for full text search
      Returns:
    • createIndex

      public OIndex createIndex(String iType)
      Creates an index on this property. Indexes speed up queries but slow down insert and update operations. For massive inserts we suggest to remove the index, make the massive insert and recreate it.
      Specified by:
      createIndex in interface OProperty
      Parameters:
      iType -
      Returns:
    • createIndex

      public OIndex createIndex(OClass.INDEX_TYPE iType, ODocument metadata)
      Description copied from interface: OProperty
      Creates an index on this property. Indexes speed up queries but slow down insert and update operations. For massive inserts we suggest to remove the index, make the massive insert and recreate it.
      Specified by:
      createIndex in interface OProperty
      Parameters:
      iType - One of types supported.
      • UNIQUE: Doesn't allow duplicates
      • NOTUNIQUE: Allow duplicates
      • FULLTEXT: Indexes single word for full text search
      metadata - the index metadata
      Returns:
      see OClass.createIndex(String, OClass.INDEX_TYPE, String...).
    • createIndex

      public OIndex createIndex(String iType, ODocument metadata)
      Description copied from interface: OProperty
      Creates an index on this property. Indexes speed up queries but slow down insert and update operations. For massive inserts we suggest to remove the index, make the massive insert and recreate it.
      Specified by:
      createIndex in interface OProperty
      Parameters:
      iType - One of types supported.
      • UNIQUE: Doesn't allow duplicates
      • NOTUNIQUE: Allow duplicates
      • FULLTEXT: Indexes single word for full text search
      metadata - the index metadata
      Returns:
      see OClass.createIndex(String, OClass.INDEX_TYPE, String...).
    • dropIndexes

      @Deprecated public OPropertyImpl dropIndexes()
      Deprecated.
      Use SQL command instead.
      Remove the index on property
      Specified by:
      dropIndexes in interface OProperty
      Returns:
    • dropIndexesInternal

      @Deprecated public void dropIndexesInternal()
      Deprecated.
      Remove the index on property
    • getIndex

      @Deprecated public OIndex getIndex()
      Deprecated.
      Returns the first index defined for the property.
      Specified by:
      getIndex in interface OProperty
      Returns:
      The first index in which this property participates as first key item.
    • getIndexes

      @Deprecated public Set<OIndex> getIndexes()
      Deprecated.
      Specified by:
      getIndexes in interface OProperty
      Returns:
      All indexes in which this property participates as first key item.
    • isIndexed

      @Deprecated public boolean isIndexed()
      Deprecated.
      Description copied from interface: OProperty
      Indicates whether property is contained in indexes as its first key item. If you would like to fetch all indexes or check property presence in other indexes use OProperty.getAllIndexes() instead.
      Specified by:
      isIndexed in interface OProperty
      Returns:
      true if and only if this property is contained in indexes as its first key item.
    • getOwnerClass

      public OClass getOwnerClass()
      Specified by:
      getOwnerClass in interface OProperty
    • getLinkedClass

      public OClass getLinkedClass()
      Returns the linked class in lazy mode because while unmarshalling the class could be not loaded yet.
      Specified by:
      getLinkedClass in interface OProperty
      Returns:
    • checkSupportLinkedClass

      public static void checkSupportLinkedClass(OType type)
    • getLinkedType

      public OType getLinkedType()
      Specified by:
      getLinkedType in interface OProperty
    • checkLinkTypeSupport

      public static void checkLinkTypeSupport(OType type)
    • isNotNull

      public boolean isNotNull()
      Specified by:
      isNotNull in interface OProperty
    • isMandatory

      public boolean isMandatory()
      Specified by:
      isMandatory in interface OProperty
    • isReadonly

      public boolean isReadonly()
      Specified by:
      isReadonly in interface OProperty
    • getMin

      public String getMin()
      Description copied from interface: OProperty
      Min behavior depends on the Property OType.

      • String : minimum length
      • Number : minimum value
      • date and time : minimum time in millisecond, date must be written in the storage date format
      • binary : minimum size of the byte array
      • List,Set,Collection : minimum size of the collection
      Specified by:
      getMin in interface OProperty
      Returns:
      String, can be null
    • getMax

      public String getMax()
      Description copied from interface: OProperty
      Max behavior depends on the Property OType.

      • String : maximum length
      • Number : maximum value
      • date and time : maximum time in millisecond, date must be written in the storage date format
      • binary : maximum size of the byte array
      • List,Set,Collection : maximum size of the collection
      Specified by:
      getMax in interface OProperty
      Returns:
      String, can be null
    • quoteString

      protected static Object quoteString(String s)
    • getDefaultValue

      public String getDefaultValue()
      Description copied from interface: OProperty
      Default value for the property; can be function
      Specified by:
      getDefaultValue in interface OProperty
      Returns:
      String, can be null
    • getRegexp

      public String getRegexp()
      Specified by:
      getRegexp in interface OProperty
    • getCustom

      public String getCustom(String iName)
      Specified by:
      getCustom in interface OProperty
    • getCustomInternal

      public Map<String,String> getCustomInternal()
    • removeCustom

      public void removeCustom(String iName)
      Specified by:
      removeCustom in interface OProperty
    • getCustomKeys

      public Set<String> getCustomKeys()
      Specified by:
      getCustomKeys in interface OProperty
    • get

      public Object get(OProperty.ATTRIBUTES attribute)
      Specified by:
      get in interface OProperty
    • set

      public void set(OProperty.ATTRIBUTES attribute, Object iValue)
      Specified by:
      set in interface OProperty
    • getCollate

      public OCollate getCollate()
      Specified by:
      getCollate in interface OProperty
    • setCollate

      public OProperty setCollate(OCollate collate)
      Specified by:
      setCollate in interface OProperty
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface OProperty
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • fromStream

      public void fromStream(ODocument document)
    • getAllIndexes

      public Collection<OIndex> getAllIndexes()
      Specified by:
      getAllIndexes in interface OProperty
      Returns:
      All indexes in which this property participates.
    • toStream

      public ODocument toStream()
    • acquireSchemaReadLock

      public void acquireSchemaReadLock()
    • releaseSchemaReadLock

      public void releaseSchemaReadLock()
    • acquireSchemaWriteLock

      public void acquireSchemaWriteLock()
    • releaseSchemaWriteLock

      public void releaseSchemaWriteLock()
    • checkEmbedded

      public void checkEmbedded()
    • getDatabase

      protected ODatabaseDocumentInternal getDatabase()
    • checkForDateFormat

      protected void checkForDateFormat(String iDateAsString)
    • isDistributedCommand

      protected boolean isDistributedCommand()
    • getId

      public Integer getId()
      Specified by:
      getId in interface OProperty
    • toNetworkStream

      public ODocument toNetworkStream()