JPA Interface

ManagedType<X>

Type Parameters:
<X> - The represented type.
Super Interfaces:
Type<X>

Instances of the type ManagedType represent entity, mapped superclass, and embeddable types.
Since:
JPA 2.0

Public Methods

Attribute<?superX,?> getAttribute(String name)
Return the attribute of the managed type that corresponds to the specified name.
Parameters:
name - the name of the represented attribute
Return:
attribute with given name
Throws:
IllegalArgumentException - if attribute of the given name is not present in the managed type
Since:
JPA 2.0
Set<Attribute<?superX,?>> getAttributes()
Return the attributes of the managed type.
Return:
attributes of the managed type
Since:
JPA 2.0
CollectionAttribute<?superX,?> getCollection(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
Return:
CollectionAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not present in the managed type
Since:
JPA 2.0
CollectionAttribute<?superX,E> getCollection(String name, 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
Return:
CollectionAttribute of the given name and element type
Throws:
IllegalArgumentException - if attribute of the given name and type is not present in the managed type
Since:
JPA 2.0
Attribute<X,?> getDeclaredAttribute(String name)
Return the attribute declared by the managed type that corresponds to the specified name.
Parameters:
name - the name of the represented attribute
Return:
attribute with given name
Throws:
IllegalArgumentException - if attribute of the given name is not declared in the managed type
Since:
JPA 2.0
Return the attributes declared by the managed type.
Returns empty set if the managed type has no declared attributes.
Return:
declared attributes of the managed type
Since:
JPA 2.0
Return the Collection-valued attribute declared by the managed type that corresponds to the specified name.
Parameters:
name - the name of the represented attribute
Return:
declared CollectionAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not declared in the managed type
Since:
JPA 2.0
CollectionAttribute<X,E> getDeclaredCollection(String name, 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
Return:
declared CollectionAttribute of the given name and element type
Throws:
IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
Since:
JPA 2.0
ListAttribute<X,?> getDeclaredList(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
Return:
declared ListAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not declared in the managed type
Since:
JPA 2.0
ListAttribute<X,E> getDeclaredList(String name, 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
Return:
declared ListAttribute of the given name and element type
Throws:
IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
Since:
JPA 2.0
MapAttribute<X,?,?> getDeclaredMap(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
Return:
declared MapAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not declared in the managed type
Since:
JPA 2.0
MapAttribute<X,K,V> getDeclaredMap(String name, Class<K> keyType, 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
Return:
declared MapAttribute of the given name and key and value types
Throws:
IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
Since:
JPA 2.0
Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) declared by the managed type.
Returns empty set if the managed type has no declared multi-valued attributes.
Return:
declared Collection-, Set-, List-, and Map-valued attributes
Since:
JPA 2.0
SetAttribute<X,?> getDeclaredSet(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
Return:
declared SetAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not declared in the managed type
Since:
JPA 2.0
SetAttribute<X,E> getDeclaredSet(String name, 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
Return:
declared SetAttribute of the given name and element type
Throws:
IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
Since:
JPA 2.0
Return the single-valued attribute declared by the managed type that corresponds to the specified name.
Parameters:
name - the name of the represented attribute
Return:
declared single-valued attribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not declared in the managed type
Since:
JPA 2.0
SingularAttribute<X,Y> getDeclaredSingularAttribute(String name, Class<Y> type)
Return the single-valued attribute declared by the managed type that corresponds to the specified name and Java type.
Parameters:
name - the name of the represented attribute
type - the type of the represented attribute
Return:
declared single-valued attribute of the given name and type
Throws:
IllegalArgumentException - if attribute of the given name and type is not declared in the managed type
Since:
JPA 2.0
Return the single-valued attributes declared by the managed type.
Returns empty set if the managed type has no declared single-valued attributes.
Return:
declared single-valued attributes
Since:
JPA 2.0
Class<X> getJavaType()
Return the represented Java type.
Return:
Java type
Inherited from:
Type<X>
Since:
JPA 2.0
ListAttribute<?superX,?> getList(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
Return:
ListAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not present in the managed type
Since:
JPA 2.0
ListAttribute<?superX,E> getList(String name, 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
Return:
ListAttribute of the given name and element type
Throws:
IllegalArgumentException - if attribute of the given name and type is not present in the managed type
Since:
JPA 2.0
MapAttribute<?superX,?,?> getMap(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
Return:
MapAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not present in the managed type
Since:
JPA 2.0
MapAttribute<?superX,K,V> getMap(String name, Class<K> keyType, 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
Return:
MapAttribute of the given name and key and value types
Throws:
IllegalArgumentException - if attribute of the given name and type is not present in the managed type
Since:
JPA 2.0
Type<X>.PersistenceType getPersistenceType()
Return the persistence type.
Return:
persistence type
Inherited from:
Type<X>
Since:
JPA 2.0
Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) of the managed type.
Returns empty set if the managed type has no multi-valued attributes.
Return:
Collection-, Set-, List-, and Map-valued attributes
Since:
JPA 2.0
SetAttribute<?superX,?> getSet(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
Return:
SetAttribute of the given name
Throws:
IllegalArgumentException - if attribute of the given name is not present in the managed type
Since:
JPA 2.0
SetAttribute<?superX,E> getSet(String name, 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
Return:
SetAttribute of the given name and element type
Throws:
IllegalArgumentException - if attribute of the given name and type is not present in the managed type
Since:
JPA 2.0
SingularAttribute<?superX,?> getSingularAttribute(String name)
Return the single-valued attribute of the managed type that corresponds to the specified name.
Parameters:
name - the name of the represented attribute
Return:
single-valued attribute with the given name
Throws:
IllegalArgumentException - if attribute of the given name is not present in the managed type
Since:
JPA 2.0
SingularAttribute<?superX,Y> getSingularAttribute(String name, Class<Y> type)
Return the single-valued attribute of the managed type that corresponds to the specified name and Java type.
Parameters:
name - the name of the represented attribute
type - the type of the represented attribute
Return:
single-valued attribute with given name and type
Throws:
IllegalArgumentException - if attribute of the given name and type is not present in the managed type
Since:
JPA 2.0
Return the single-valued attributes of the managed type.
Returns empty set if the managed type has no single-valued attributes.
Return:
single-valued attributes
Since:
JPA 2.0