org.datanucleus.jpa.metamodel
Class ManagedTypeImpl<X>

java.lang.Object
  extended by org.datanucleus.jpa.metamodel.TypeImpl<X>
      extended by org.datanucleus.jpa.metamodel.ManagedTypeImpl<X>
All Implemented Interfaces:
javax.persistence.metamodel.ManagedType<X>, javax.persistence.metamodel.Type<X>
Direct Known Subclasses:
EmbeddableTypeImpl, IdentifiableTypeImpl

public class ManagedTypeImpl<X>
extends TypeImpl<X>
implements javax.persistence.metamodel.ManagedType<X>

Implementation of JPA2 Metamodel "ManagedType". Provides a wrapper to AbstractClassMetaData.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.persistence.metamodel.Type
javax.persistence.metamodel.Type.PersistenceType
 
Field Summary
protected  java.util.Map<java.lang.String,javax.persistence.metamodel.Attribute<X,?>> attributes
           
protected  org.datanucleus.metadata.AbstractClassMetaData cmd
          DataNucleus metadata for this class.
protected  MetamodelImpl model
          The metamodel being used, where we need to look up related classes.
 
Fields inherited from class org.datanucleus.jpa.metamodel.TypeImpl
cls
 
Constructor Summary
protected ManagedTypeImpl(java.lang.Class<X> cls, org.datanucleus.metadata.AbstractClassMetaData cmd, MetamodelImpl model)
          Constructor for a managed type.
 
Method Summary
 javax.persistence.metamodel.Attribute<? super X,?> getAttribute(java.lang.String attr)
           
 java.util.Set<javax.persistence.metamodel.Attribute<? super X,?>> getAttributes()
           
 javax.persistence.metamodel.CollectionAttribute<? super X,?> getCollection(java.lang.String attr)
           
<E> javax.persistence.metamodel.CollectionAttribute<? super X,E>
getCollection(java.lang.String attr, java.lang.Class<E> elementType)
           
 javax.persistence.metamodel.Attribute<X,?> getDeclaredAttribute(java.lang.String attr)
           
 java.util.Set<javax.persistence.metamodel.Attribute<X,?>> getDeclaredAttributes()
           
 javax.persistence.metamodel.CollectionAttribute<X,?> getDeclaredCollection(java.lang.String attr)
           
<E> javax.persistence.metamodel.CollectionAttribute<X,E>
getDeclaredCollection(java.lang.String attr, java.lang.Class<E> elementType)
           
 javax.persistence.metamodel.ListAttribute<X,?> getDeclaredList(java.lang.String attr)
           
<E> javax.persistence.metamodel.ListAttribute<X,E>
getDeclaredList(java.lang.String attr, java.lang.Class<E> elementType)
           
 javax.persistence.metamodel.MapAttribute<X,?,?> getDeclaredMap(java.lang.String attr)
           
<K,V> javax.persistence.metamodel.MapAttribute<X,K,V>
getDeclaredMap(java.lang.String attr, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
           
 java.util.Set<javax.persistence.metamodel.PluralAttribute<X,?,?>> getDeclaredPluralAttributes()
           
 javax.persistence.metamodel.SetAttribute<X,?> getDeclaredSet(java.lang.String attr)
           
<E> javax.persistence.metamodel.SetAttribute<X,E>
getDeclaredSet(java.lang.String attr, java.lang.Class<E> elementType)
           
 javax.persistence.metamodel.SingularAttribute<X,?> getDeclaredSingularAttribute(java.lang.String attr)
           
<Y> javax.persistence.metamodel.SingularAttribute<X,Y>
getDeclaredSingularAttribute(java.lang.String attr, java.lang.Class<Y> type)
           
 java.util.Set<javax.persistence.metamodel.SingularAttribute<X,?>> getDeclaredSingularAttributes()
           
 javax.persistence.metamodel.ListAttribute<? super X,?> getList(java.lang.String attr)
           
<E> javax.persistence.metamodel.ListAttribute<? super X,E>
getList(java.lang.String attr, java.lang.Class<E> elementType)
           
 javax.persistence.metamodel.MapAttribute<? super X,?,?> getMap(java.lang.String attr)
           
<K,V> javax.persistence.metamodel.MapAttribute<? super X,K,V>
getMap(java.lang.String attr, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
           
 org.datanucleus.metadata.AbstractClassMetaData getMetadata()
          Convenience accessor for the metadata underlying this class.
 MetamodelImpl getModel()
           
 java.util.Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> getPluralAttributes()
           
 javax.persistence.metamodel.SetAttribute<? super X,?> getSet(java.lang.String attr)
           
<E> javax.persistence.metamodel.SetAttribute<? super X,E>
getSet(java.lang.String attr, java.lang.Class<E> elementType)
           
 javax.persistence.metamodel.SingularAttribute<? super X,?> getSingularAttribute(java.lang.String attr)
           
<Y> javax.persistence.metamodel.SingularAttribute<? super X,Y>
getSingularAttribute(java.lang.String attr, java.lang.Class<Y> type)
           
 java.util.Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> getSingularAttributes()
           
 
Methods inherited from class org.datanucleus.jpa.metamodel.TypeImpl
getJavaType, getPersistenceType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.persistence.metamodel.Type
getJavaType, getPersistenceType
 

Field Detail

cmd

protected org.datanucleus.metadata.AbstractClassMetaData cmd
DataNucleus metadata for this class.


model

protected MetamodelImpl model
The metamodel being used, where we need to look up related classes.


attributes

protected java.util.Map<java.lang.String,javax.persistence.metamodel.Attribute<X,?>> attributes
Constructor Detail

ManagedTypeImpl

protected ManagedTypeImpl(java.lang.Class<X> cls,
                          org.datanucleus.metadata.AbstractClassMetaData cmd,
                          MetamodelImpl model)
Constructor for a managed type.

Parameters:
cls - The class
cmd - Metadata for the class
model - The model being used
Method Detail

getMetadata

public org.datanucleus.metadata.AbstractClassMetaData getMetadata()
Convenience accessor for the metadata underlying this class.

Returns:
The metadata

getModel

public MetamodelImpl getModel()

getAttribute

public javax.persistence.metamodel.Attribute<? super X,?> getAttribute(java.lang.String attr)
Specified by:
getAttribute in interface javax.persistence.metamodel.ManagedType<X>

getAttributes

public java.util.Set<javax.persistence.metamodel.Attribute<? super X,?>> getAttributes()
Specified by:
getAttributes in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredAttribute

public javax.persistence.metamodel.Attribute<X,?> getDeclaredAttribute(java.lang.String attr)
Specified by:
getDeclaredAttribute in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredAttributes

public java.util.Set<javax.persistence.metamodel.Attribute<X,?>> getDeclaredAttributes()
Specified by:
getDeclaredAttributes in interface javax.persistence.metamodel.ManagedType<X>

getCollection

public <E> javax.persistence.metamodel.CollectionAttribute<? super X,E> getCollection(java.lang.String attr,
                                                                                      java.lang.Class<E> elementType)
Specified by:
getCollection in interface javax.persistence.metamodel.ManagedType<X>

getCollection

public javax.persistence.metamodel.CollectionAttribute<? super X,?> getCollection(java.lang.String attr)
Specified by:
getCollection in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredCollection

public <E> javax.persistence.metamodel.CollectionAttribute<X,E> getDeclaredCollection(java.lang.String attr,
                                                                                      java.lang.Class<E> elementType)
Specified by:
getDeclaredCollection in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredCollection

public javax.persistence.metamodel.CollectionAttribute<X,?> getDeclaredCollection(java.lang.String attr)
Specified by:
getDeclaredCollection in interface javax.persistence.metamodel.ManagedType<X>

getList

public <E> javax.persistence.metamodel.ListAttribute<? super X,E> getList(java.lang.String attr,
                                                                          java.lang.Class<E> elementType)
Specified by:
getList in interface javax.persistence.metamodel.ManagedType<X>

getList

public javax.persistence.metamodel.ListAttribute<? super X,?> getList(java.lang.String attr)
Specified by:
getList in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredList

public <E> javax.persistence.metamodel.ListAttribute<X,E> getDeclaredList(java.lang.String attr,
                                                                          java.lang.Class<E> elementType)
Specified by:
getDeclaredList in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredList

public javax.persistence.metamodel.ListAttribute<X,?> getDeclaredList(java.lang.String attr)
Specified by:
getDeclaredList in interface javax.persistence.metamodel.ManagedType<X>

getMap

public <K,V> javax.persistence.metamodel.MapAttribute<? super X,K,V> getMap(java.lang.String attr,
                                                                            java.lang.Class<K> keyType,
                                                                            java.lang.Class<V> valueType)
Specified by:
getMap in interface javax.persistence.metamodel.ManagedType<X>

getMap

public javax.persistence.metamodel.MapAttribute<? super X,?,?> getMap(java.lang.String attr)
Specified by:
getMap in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredMap

public <K,V> javax.persistence.metamodel.MapAttribute<X,K,V> getDeclaredMap(java.lang.String attr,
                                                                            java.lang.Class<K> keyType,
                                                                            java.lang.Class<V> valueType)
Specified by:
getDeclaredMap in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredMap

public javax.persistence.metamodel.MapAttribute<X,?,?> getDeclaredMap(java.lang.String attr)
Specified by:
getDeclaredMap in interface javax.persistence.metamodel.ManagedType<X>

getSet

public <E> javax.persistence.metamodel.SetAttribute<? super X,E> getSet(java.lang.String attr,
                                                                        java.lang.Class<E> elementType)
Specified by:
getSet in interface javax.persistence.metamodel.ManagedType<X>

getSet

public javax.persistence.metamodel.SetAttribute<? super X,?> getSet(java.lang.String attr)
Specified by:
getSet in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredSet

public <E> javax.persistence.metamodel.SetAttribute<X,E> getDeclaredSet(java.lang.String attr,
                                                                        java.lang.Class<E> elementType)
Specified by:
getDeclaredSet in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredSet

public javax.persistence.metamodel.SetAttribute<X,?> getDeclaredSet(java.lang.String attr)
Specified by:
getDeclaredSet in interface javax.persistence.metamodel.ManagedType<X>

getSingularAttribute

public <Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> getSingularAttribute(java.lang.String attr,
                                                                                           java.lang.Class<Y> type)
Specified by:
getSingularAttribute in interface javax.persistence.metamodel.ManagedType<X>

getSingularAttribute

public javax.persistence.metamodel.SingularAttribute<? super X,?> getSingularAttribute(java.lang.String attr)
Specified by:
getSingularAttribute in interface javax.persistence.metamodel.ManagedType<X>

getSingularAttributes

public java.util.Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> getSingularAttributes()
Specified by:
getSingularAttributes in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredSingularAttribute

public <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredSingularAttribute(java.lang.String attr,
                                                                                           java.lang.Class<Y> type)
Specified by:
getDeclaredSingularAttribute in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredSingularAttribute

public javax.persistence.metamodel.SingularAttribute<X,?> getDeclaredSingularAttribute(java.lang.String attr)
Specified by:
getDeclaredSingularAttribute in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredSingularAttributes

public java.util.Set<javax.persistence.metamodel.SingularAttribute<X,?>> getDeclaredSingularAttributes()
Specified by:
getDeclaredSingularAttributes in interface javax.persistence.metamodel.ManagedType<X>

getPluralAttributes

public java.util.Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> getPluralAttributes()
Specified by:
getPluralAttributes in interface javax.persistence.metamodel.ManagedType<X>

getDeclaredPluralAttributes

public java.util.Set<javax.persistence.metamodel.PluralAttribute<X,?,?>> getDeclaredPluralAttributes()
Specified by:
getDeclaredPluralAttributes in interface javax.persistence.metamodel.ManagedType<X>


Copyright © 2011. All Rights Reserved.