org.datanucleus.jpa.metamodel
Class AttributeImpl<X,Y>

java.lang.Object
  extended by org.datanucleus.jpa.metamodel.AttributeImpl<X,Y>
Type Parameters:
X - The type containing the represented attribute
Y - The type of the represented attribute
All Implemented Interfaces:
javax.persistence.metamodel.Attribute<X,Y>
Direct Known Subclasses:
PluralAttributeImpl, SingularAttributeImpl

public class AttributeImpl<X,Y>
extends java.lang.Object
implements javax.persistence.metamodel.Attribute<X,Y>

Implementation of JPA2 Metamodel "Attribute". Provides a wrapper to AbstractMemberMetaData.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.persistence.metamodel.Attribute
javax.persistence.metamodel.Attribute.PersistentAttributeType
 
Constructor Summary
AttributeImpl(org.datanucleus.metadata.AbstractMemberMetaData mmd, ManagedTypeImpl<X> owner)
           
 
Method Summary
 javax.persistence.metamodel.ManagedType<X> getDeclaringType()
           
 java.lang.reflect.Member getJavaMember()
           
 java.lang.Class<Y> getJavaType()
           
 org.datanucleus.metadata.AbstractMemberMetaData getMetadata()
          Convenience accessor for the metadata underlying this member.
 java.lang.String getName()
           
 javax.persistence.metamodel.Attribute.PersistentAttributeType getPersistentAttributeType()
           
 javax.persistence.metamodel.Type<Y> getType()
          Return the type of the attribute.
 boolean isAssociation()
           
 boolean isCollection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeImpl

public AttributeImpl(org.datanucleus.metadata.AbstractMemberMetaData mmd,
                     ManagedTypeImpl<X> owner)
Method Detail

getMetadata

public org.datanucleus.metadata.AbstractMemberMetaData getMetadata()
Convenience accessor for the metadata underlying this member.

Returns:
The metadata

getDeclaringType

public javax.persistence.metamodel.ManagedType<X> getDeclaringType()
Specified by:
getDeclaringType in interface javax.persistence.metamodel.Attribute<X,Y>

getJavaMember

public java.lang.reflect.Member getJavaMember()
Specified by:
getJavaMember in interface javax.persistence.metamodel.Attribute<X,Y>

getJavaType

public java.lang.Class<Y> getJavaType()
Specified by:
getJavaType in interface javax.persistence.metamodel.Attribute<X,Y>

getName

public java.lang.String getName()
Specified by:
getName in interface javax.persistence.metamodel.Attribute<X,Y>

getPersistentAttributeType

public javax.persistence.metamodel.Attribute.PersistentAttributeType getPersistentAttributeType()
Specified by:
getPersistentAttributeType in interface javax.persistence.metamodel.Attribute<X,Y>

isAssociation

public boolean isAssociation()
Specified by:
isAssociation in interface javax.persistence.metamodel.Attribute<X,Y>

isCollection

public boolean isCollection()
Specified by:
isCollection in interface javax.persistence.metamodel.Attribute<X,Y>

getType

public final javax.persistence.metamodel.Type<Y> getType()
Return the type of the attribute. If the type is simple then returns that java type, otherwise if a collection then returns the element type.

Returns:
The type of attribute


Copyright © 2011. All Rights Reserved.