Class ObjAttribute

    • Field Detail

      • usedForLocking

        protected boolean usedForLocking
      • dbAttributePath

        protected String dbAttributePath
    • Constructor Detail

      • ObjAttribute

        public ObjAttribute()
      • ObjAttribute

        public ObjAttribute​(String name)
      • ObjAttribute

        public ObjAttribute​(ObjAttribute attribute)
        Creates a clone of an ObjAttribute argument.
        Since:
        3.0
    • Method Detail

      • getJavaClass

        public Class<?> getJavaClass()
        Returns Java class of an object property described by this attribute. Wraps any thrown exceptions into CayenneRuntimeException.
      • getType

        public String getType()
        Returns fully qualified Java class name of the object property represented by this attribute.
      • setType

        public void setType​(String type)
        Sets the type of the data object property. Type is expected to be a fully qualified Java class name.
      • isPrimaryKey

        public boolean isPrimaryKey()
        Since:
        3.0
      • isUsedForLocking

        public boolean isUsedForLocking()
        Returns whether this attribute should be used for locking.
        Since:
        1.1
      • setUsedForLocking

        public void setUsedForLocking​(boolean usedForLocking)
        Sets whether this attribute should be used for locking.
        Since:
        1.1
      • getDbAttribute

        public DbAttribute getDbAttribute()
        Returns a DbAttribute mapped by this ObjAttribute.
      • isInherited

        public boolean isInherited()
        Returns true if attribute inherited from a super entity.
        Since:
        3.0
      • getDbAttributeName

        public String getDbAttributeName()
        Returns the the name of the mapped DbAttribute. This value is the same as "dbAttributePath" for regular attributes mapped to columns. It is equql to the last path component for the flattened attributes.
      • setDbAttributePath

        public void setDbAttributePath​(String dbAttributePath)
      • getDbAttributePath

        public String getDbAttributePath()
        Returns a dot-separated path that starts in the root DbEntity that maps to this attribute's ObjEntity and spans zero or more relationships, always ending in a DbAttribute name.
      • isFlattened

        public boolean isFlattened()
        Returns whether this attribute is "flattened", meaning that it points to a column from an entity other than the DbEntity mapped to the parent ObjEntity.
        Since:
        3.0
      • getClientAttribute

        public ObjAttribute getClientAttribute()
        Returns an ObjAttribute stripped of any server-side information, such as DbAttribute mapping.
        Since:
        1.2
      • updateDbAttributePath

        public void updateDbAttributePath()
        Updates DbAttributePath for this ObjAttribute