Class AttributeImpl<X,​T>

  • Type Parameters:
    X - The represented type that contains the attribute
    T - The type of the represented attribute
    All Implemented Interfaces:
    java.io.Serializable, javax.persistence.metamodel.Attribute<X,​T>
    Direct Known Subclasses:
    PluralAttributeImpl, SingularAttributeImpl

    public abstract class AttributeImpl<X,​T>
    extends java.lang.Object
    implements javax.persistence.metamodel.Attribute<X,​T>, java.io.Serializable

    Purpose: Provides the implementation for the Attribute interface of the JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API)

    Description: An attribute of a Java type

    Since:
    EclipseLink 1.2 - JPA 2.0
    See Also:
    Attribute, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface javax.persistence.metamodel.Attribute

        javax.persistence.metamodel.Attribute.PersistentAttributeType
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AttributeImpl​(ManagedTypeImpl<X> managedType, org.eclipse.persistence.mappings.DatabaseMapping mapping)
      INTERNAL:
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      javax.persistence.metamodel.ManagedType<X> getDeclaringType()
      Return the managed type representing the type in which the attribute was declared.
      protected org.eclipse.persistence.descriptors.ClassDescriptor getDescriptor()
      INTERNAL: Return the Descriptor associated with this attribute
      java.lang.reflect.Member getJavaMember()
      Return the java.lang.reflect.Member for the represented attribute.
      abstract java.lang.Class<T> getJavaType()
      Return the Java type of the represented attribute.
      ManagedTypeImpl<X> getManagedTypeImpl()
      INTERNAL: Return the managed type representing the type in which the member was declared.
      org.eclipse.persistence.mappings.DatabaseMapping getMapping()
      INTERNAL: Return the databaseMapping that represents the type
      protected MetamodelImpl getMetamodel()
      INTERNAL: Return the concrete metamodel that this attribute is associated with.
      java.lang.String getName()
      Return the name of the attribute.
      javax.persistence.metamodel.Attribute.PersistentAttributeType getPersistentAttributeType()
      Return the persistent attribute type for the attribute.
      boolean isAssociation()
      Is the attribute an association.
      boolean isCollection()
      Is the attribute collection-valued.
      abstract boolean isPlural()
      INTERNAL: Return whether the attribute is plural or singular
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AttributeImpl

        protected AttributeImpl​(ManagedTypeImpl<X> managedType,
                                org.eclipse.persistence.mappings.DatabaseMapping mapping)
        INTERNAL:
        Parameters:
        managedType -
        mapping -
    • Method Detail

      • getDeclaringType

        public javax.persistence.metamodel.ManagedType<X> getDeclaringType()
        Return the managed type representing the type in which the attribute was declared.
        Specified by:
        getDeclaringType in interface javax.persistence.metamodel.Attribute<X,​T>
        Returns:
        declaring type
      • getDescriptor

        protected org.eclipse.persistence.descriptors.ClassDescriptor getDescriptor()
        INTERNAL: Return the Descriptor associated with this attribute
        Returns:
      • getJavaMember

        public java.lang.reflect.Member getJavaMember()
        Return the java.lang.reflect.Member for the represented attribute. In the case of property access the get method will be returned
        Specified by:
        getJavaMember in interface javax.persistence.metamodel.Attribute<X,​T>
        Returns:
        corresponding java.lang.reflect.Member
      • getJavaType

        public abstract java.lang.Class<T> getJavaType()
        Return the Java type of the represented attribute.
        Specified by:
        getJavaType in interface javax.persistence.metamodel.Attribute<X,​T>
        Returns:
        Java type
      • getManagedTypeImpl

        public ManagedTypeImpl<X> getManagedTypeImpl()
        INTERNAL: Return the managed type representing the type in which the member was declared.
        Returns:
      • getMapping

        public org.eclipse.persistence.mappings.DatabaseMapping getMapping()
        INTERNAL: Return the databaseMapping that represents the type
        Returns:
      • getMetamodel

        protected MetamodelImpl getMetamodel()
        INTERNAL: Return the concrete metamodel that this attribute is associated with.
        Returns:
        MetamodelImpl
      • getName

        public java.lang.String getName()
        Return the name of the attribute.
        Specified by:
        getName in interface javax.persistence.metamodel.Attribute<X,​T>
        Returns:
        name
      • getPersistentAttributeType

        public javax.persistence.metamodel.Attribute.PersistentAttributeType getPersistentAttributeType()
        Return the persistent attribute type for the attribute.
        Specified by:
        getPersistentAttributeType in interface javax.persistence.metamodel.Attribute<X,​T>
        Returns:
        persistent attribute type
      • isAssociation

        public boolean isAssociation()
        Is the attribute an association.
        Specified by:
        isAssociation in interface javax.persistence.metamodel.Attribute<X,​T>
        Returns:
        whether boolean indicating whether attribute corresponds to an association
      • isCollection

        public boolean isCollection()
        Is the attribute collection-valued.
        Specified by:
        isCollection in interface javax.persistence.metamodel.Attribute<X,​T>
        Returns:
        boolean indicating whether attribute is collection-valued.

        This will be true for the mappings CollectionMapping, AbstractCompositeCollectionMapping, AbstractCompositeDirectCollectionMapping and their subclasses

      • isPlural

        public abstract boolean isPlural()
        INTERNAL: Return whether the attribute is plural or singular
        Returns: