Class NamedElement

java.lang.Object
ru.curs.celesta.score.NamedElement
Direct Known Subclasses:
Column, Grain, GrainElement, Parameter

public abstract class NamedElement extends Object
A named element of metamodel (e.g. table or column) that must have a unique identifier name.
  • Field Details

    • MAX_IDENTIFIER_LENGTH

      public static final int MAX_IDENTIFIER_LENGTH
      The maximal length of an identifier of Celesta.
      See Also:
  • Constructor Details

  • Method Details

    • limitName

      public static String limitName(String value)
      Restricts identifier length by maximal number of symbols.
      Parameters:
      value - Identifier of arbitrary length.
      Returns:
      "Shortcut" identifier that has a hash code of the original one as its last 8 symbols.
    • limitName

      public static String limitName(String value, String postfix)
      Restricts identifier length with a postfix by maximal number of symbols. The resulting form becomes: <restricted identifier><postfix>. For example my_very_long_table_name with _nextValueProc becomes - my_very_73FAF9A9_nextValueProc
      Parameters:
      value - Identifier of arbitrary length.
      postfix - Identifier postfix.
      Returns:
      "Shortcut" identifier that has a hash code of the original one as its last 8 symbols plus postfix.
    • getName

      public final String getName()
      Returns the name.
    • getQuotedName

      public final String getQuotedName()
      Returns the name in ANSI quotes (e.g. "celestaIdentifier").
    • getQuotedNameIfNeeded

      public final String getQuotedNameIfNeeded()
      Returns the name in ANSI quotes if needed.
      Returns:
    • hashCode

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

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

      public String getCelestaDoc()
      Returns value of document string for this element.
      Returns:
    • setCelestaDoc

      public void setCelestaDoc(String celestaDoc) throws ParseException
      Sets value of document string.
      Parameters:
      celestaDoc - new value
      Throws:
      ParseException - incorrect CelestaDoc