EclipseLink 2.0.0_ 2.0.0.v20090424-r4050 API Reference

javax.persistence.metamodel
Interface ManagedType<X>

Type Parameters:
X - The represented type.
All Superinterfaces:
Bindable<X>, Type<X>
All Known Subinterfaces:
Embeddable<X>, Entity<X>, IdentifiableType<X>, MappedSuperclass<X>

public interface ManagedType<X>
extends Type<X>, Bindable<X>

Instances of the type ManagedType represent entity, mapped superclass, and embeddable types.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.persistence.metamodel.Type
Type.PersistenceType
 
Nested classes/interfaces inherited from interface javax.persistence.metamodel.Bindable
Bindable.BindableType
 
Method Summary
 Attribute<? super X,?> getAttribute(java.lang.String name)
          Return the non-collection-valued attribute of the managed type that corresponds to the specified name in the represented type.
<Y> Attribute<? super X,Y>
getAttribute(java.lang.String name, java.lang.Class<Y> type)
          Return the non-collection-valued attribute of the managed type that corresponds to the specified name and Java type in the represented type.
 java.util.Set<Attribute<? super X,?>> getAttributes()
          Return the non-collection-valued attributes of the managed type.
 Collection<? super X,?> getCollection(java.lang.String name)
          Return the Collection-valued attribute of the managed type that corresponds to the specified name.
<E> Collection<? super X,E>
getCollection(java.lang.String name, java.lang.Class<E> elementType)
          Return the Collection-valued attribute of the managed type that corresponds to the specified name and Java element type.
 java.util.Set<AbstractCollection<? super X,?,?>> getCollections()
          Return all collection-valued attributes of the managed type.
 Attribute<X,?> getDeclaredAttribute(java.lang.String name)
          Return the declared non-collection-valued attribute of the managed type that corresponds to the specified name in the represented type.
<Y> Attribute<X,Y>
getDeclaredAttribute(java.lang.String name, java.lang.Class<Y> type)
          Return the declared non-collection-valued attribute of the managed type that corresponds to the specified name and Java type in the represented type.
 java.util.Set<Attribute<X,?>> getDeclaredAttributes()
          Return the non-collection-valued attributes declared by the managed type.
 Collection<X,?> getDeclaredCollection(java.lang.String name)
          Return the Collection-valued attribute declared by the managed type that corresponds to the specified name.
<E> Collection<X,E>
getDeclaredCollection(java.lang.String name, java.lang.Class<E> elementType)
          Return the Collection-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
 java.util.Set<AbstractCollection<X,?,?>> getDeclaredCollections()
          Return all collection-valued attributes declared by the managed type.
 List<X,?> getDeclaredList(java.lang.String name)
          Return the List-valued attribute declared by the managed type that corresponds to the specified name.
<E> List<X,E>
getDeclaredList(java.lang.String name, java.lang.Class<E> elementType)
          Return the List-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
 Map<X,?,?> getDeclaredMap(java.lang.String name)
          Return the Map-valued attribute declared by the managed type that corresponds to the specified name.
<K,V> Map<X,K,V>
getDeclaredMap(java.lang.String name, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
          Return the Map-valued attribute declared by the managed type that corresponds to the specified name and Java key and value types.
 Set<X,?> getDeclaredSet(java.lang.String name)
          Return the Set-valued attribute declared by the managed type that corresponds to the specified name.
<E> Set<X,E>
getDeclaredSet(java.lang.String name, java.lang.Class<E> elementType)
          Return the Set-valued attribute declared by the managed type that corresponds to the specified name and Java element type.
 List<? super X,?> getList(java.lang.String name)
          Return the List-valued attribute of the managed type that corresponds to the specified name.
<E> List<? super X,E>
getList(java.lang.String name, java.lang.Class<E> elementType)
          Return the List-valued attribute of the managed type that corresponds to the specified name and Java element type.
 Map<? super X,?,?> getMap(java.lang.String name)
          Return the Map-valued attribute of the managed type that corresponds to the specified name.
<K,V> Map<? super X,K,V>
getMap(java.lang.String name, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
          Return the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.
 Set<? super X,?> getSet(java.lang.String name)
          Return the Set-valued attribute of the managed type that corresponds to the specified name.
<E> Set<? super X,E>
getSet(java.lang.String name, java.lang.Class<E> elementType)
          Return the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.
 
Methods inherited from interface javax.persistence.metamodel.Type
getJavaType, getPersistenceType
 
Methods inherited from interface javax.persistence.metamodel.Bindable
getBindableType, getJavaType
 

Method Detail

getAttribute

<Y> Attribute<? super X,Y> getAttribute(java.lang.String name,
                                        java.lang.Class<Y> type)
Return the non-collection-valued attribute of the managed type that corresponds to the specified name and Java type in the represented type.

Parameters:
name - the name of the represented attribute
type - the type of the represented attribute
Returns:
non-collection attribute with given name and type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getDeclaredAttribute

<Y> Attribute<X,Y> getDeclaredAttribute(java.lang.String name,
                                        java.lang.Class<Y> type)
Return the declared non-collection-valued attribute of the managed type that corresponds to the specified name and Java type in the represented type.

Parameters:
name - the name of the represented attribute
type - the type of the represented attribute
Returns:
declared non-collection attribute of the given name and type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getAttributes

java.util.Set<Attribute<? super X,?>> getAttributes()
Return the non-collection-valued attributes of the managed type.

Returns:
non-collection attributes

getDeclaredAttributes

java.util.Set<Attribute<X,?>> getDeclaredAttributes()
Return the non-collection-valued attributes declared by the managed type.

Returns:
declared non-collection attributes

getCollection

<E> Collection<? super X,E> getCollection(java.lang.String name,
                                          java.lang.Class<E> elementType)
Return the Collection-valued attribute of the managed type that corresponds to the specified name and Java element type.

Parameters:
name - the name of the represented attribute
elementType - the element type of the represented attribute
Returns:
Collection attribute of the given name and element type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getSet

<E> Set<? super X,E> getSet(java.lang.String name,
                            java.lang.Class<E> elementType)
Return the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.

Parameters:
name - the name of the represented attribute
elementType - the element type of the represented attribute
Returns:
Set attribute of the given name and element type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getList

<E> List<? super X,E> getList(java.lang.String name,
                              java.lang.Class<E> elementType)
Return the List-valued attribute of the managed type that corresponds to the specified name and Java element type.

Parameters:
name - the name of the represented attribute
elementType - the element type of the represented attribute
Returns:
List attribute of the given name and element type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getMap

<K,V> Map<? super X,K,V> getMap(java.lang.String name,
                                java.lang.Class<K> keyType,
                                java.lang.Class<V> valueType)
Return the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.

Parameters:
name - the name of the represented attribute
keyType - the key type of the represented attribute
valueType - the value type of the represented attribute
Returns:
Map attribute of the given name and key and value types
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getDeclaredCollection

<E> Collection<X,E> getDeclaredCollection(java.lang.String name,
                                          java.lang.Class<E> elementType)
Return the Collection-valued attribute declared by the managed type that corresponds to the specified name and Java element type.

Parameters:
name - the name of the represented attribute
elementType - the element type of the represented attribute
Returns:
declared Collection attribute of the given name and element type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getDeclaredSet

<E> Set<X,E> getDeclaredSet(java.lang.String name,
                            java.lang.Class<E> elementType)
Return the Set-valued attribute declared by the managed type that corresponds to the specified name and Java element type.

Parameters:
name - the name of the represented attribute
elementType - the element type of the represented attribute
Returns:
declared Set attribute of the given name and element type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getDeclaredList

<E> List<X,E> getDeclaredList(java.lang.String name,
                              java.lang.Class<E> elementType)
Return the List-valued attribute declared by the managed type that corresponds to the specified name and Java element type.

Parameters:
name - the name of the represented attribute
elementType - the element type of the represented attribute
Returns:
declared List attribute of the given name and element type
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getDeclaredMap

<K,V> Map<X,K,V> getDeclaredMap(java.lang.String name,
                                java.lang.Class<K> keyType,
                                java.lang.Class<V> valueType)
Return the Map-valued attribute declared by the managed type that corresponds to the specified name and Java key and value types.

Parameters:
name - the name of the represented attribute
keyType - the key type of the represented attribute
valueType - the value type of the represented attribute
Returns:
declared Map attribute of the given name and key and value types
Throws:
java.lang.IllegalArgumentException - if attribute of the given name and type is not present in the managed type

getCollections

java.util.Set<AbstractCollection<? super X,?,?>> getCollections()
Return all collection-valued attributes of the managed type.

Returns:
collection valued attributes

getDeclaredCollections

java.util.Set<AbstractCollection<X,?,?>> getDeclaredCollections()
Return all collection-valued attributes declared by the managed type.

Returns:
declared collection valued attributes

getAttribute

Attribute<? super X,?> getAttribute(java.lang.String name)
Return the non-collection-valued attribute of the managed type that corresponds to the specified name in the represented type.

Parameters:
name - the name of the represented attribute
Returns:
non-collection attribute with the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getDeclaredAttribute

Attribute<X,?> getDeclaredAttribute(java.lang.String name)
Return the declared non-collection-valued attribute of the managed type that corresponds to the specified name in the represented type.

Parameters:
name - the name of the represented attribute
Returns:
declared non-collection attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getCollection

Collection<? super X,?> getCollection(java.lang.String name)
Return the Collection-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
Collection attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getSet

Set<? super X,?> getSet(java.lang.String name)
Return the Set-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
Set attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getList

List<? super X,?> getList(java.lang.String name)
Return the List-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
List attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getMap

Map<? super X,?,?> getMap(java.lang.String name)
Return the Map-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
Map attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getDeclaredCollection

Collection<X,?> getDeclaredCollection(java.lang.String name)
Return the Collection-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
declared Collection attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getDeclaredSet

Set<X,?> getDeclaredSet(java.lang.String name)
Return the Set-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
declared Set attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getDeclaredList

List<X,?> getDeclaredList(java.lang.String name)
Return the List-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
declared List attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

getDeclaredMap

Map<X,?,?> getDeclaredMap(java.lang.String name)
Return the Map-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name - the name of the represented attribute
Returns:
declared Map attribute of the given name
Throws:
java.lang.IllegalArgumentException - if attribute of the given name is not present in the managed type

EclipseLink 2.0.0_ 2.0.0.v20090424-r4050 API Reference