X
- thepublic abstract class AbstractManagedType<X> extends Object implements javax.persistence.metamodel.ManagedType<X>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractManagedType.AttributeNameFilter<X> |
static class |
AbstractManagedType.AttributeTypeFilter<X,Y>
Selects if the attribute type matches the given Java class.
|
static class |
AbstractManagedType.DeclaredAttributeFilter<X> |
static class |
AbstractManagedType.ElementTypeFilter<X,E>
Selects plural attribute of given element type.
|
static class |
AbstractManagedType.EntryTypeFilter<X,K,V> |
static interface |
AbstractManagedType.Filter<T>
Affirms if a given element satisfy a condition.
|
static class |
AbstractManagedType.IdAttributeFilter<X> |
static class |
AbstractManagedType.PluralCategoryFilter<X> |
static class |
AbstractManagedType.SingularAttributeFilter<X>
Affirms if the given attribute is a Singular attribute.
|
static class |
AbstractManagedType.VersionAttributeFilter<X> |
Modifier and Type | Field and Description |
---|---|
Class<X> |
cls |
ClassMetaData |
meta |
MetamodelImpl |
model |
Modifier | Constructor and Description |
---|---|
protected |
AbstractManagedType(Class<X> cls,
MetamodelImpl model)
A protected constructor for creating psudo-managed types.
|
|
AbstractManagedType(ClassMetaData meta,
MetamodelImpl model)
Construct a managed type.
|
Modifier and Type | Method and Description |
---|---|
static <T,C extends Collection<E>,E> |
filter(Collection<T> original,
C result,
AbstractManagedType.Filter<T> f1,
AbstractManagedType.Filter<T> f2,
AbstractManagedType.Filter<T> f3,
AbstractManagedType.Filter<T> f4)
Applies chain of filters ANDed on the given collection to populate the given result.
|
javax.persistence.metamodel.Attribute<? super X,?> |
getAttribute(String name)
Returns the attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.Attribute<? super X,Y> |
getAttribute(String name,
Class<Y> type)
Returns the attribute of the given name and Java type.
|
Set<javax.persistence.metamodel.Attribute<? super X,?>> |
getAttributes()
Returns all the attributes of the managed type including attributes of the super type.
|
javax.persistence.metamodel.CollectionAttribute<? super X,?> |
getCollection(String name)
Returns the attribute of the given name and of type java.util.Collection.
|
<E> javax.persistence.metamodel.CollectionAttribute<? super X,E> |
getCollection(String name,
Class<E> elementType)
Returns the attribute of the given name, of type java.util.Collection and contains the
given element type.
|
javax.persistence.metamodel.Attribute<X,?> |
getDeclaredAttribute(String name)
Returns the declared attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.Attribute<X,Y> |
getDeclaredAttribute(String name,
Class<Y> type)
Returns the declared attribute of the given name and Java type.
|
Set<javax.persistence.metamodel.Attribute<X,?>> |
getDeclaredAttributes()
Returns all the attributes declared by this managed type only.
|
javax.persistence.metamodel.CollectionAttribute<X,?> |
getDeclaredCollection(String name)
Returns the declared attribute of the given name and of type java.util.Collection.
|
<E> javax.persistence.metamodel.CollectionAttribute<X,E> |
getDeclaredCollection(String name,
Class<E> elementType)
Returns the declared attribute of the given name, of type java.util.Collection and contains
the given element type.
|
<Y> javax.persistence.metamodel.SingularAttribute<X,Y> |
getDeclaredId(Class<Y> type)
Returns the declared attribute of given type that corresponds to the id attribute of this
identifiable managed type.
|
javax.persistence.metamodel.ListAttribute<X,?> |
getDeclaredList(String name)
Returns the declared attribute of the given name and of type java.util.List.
|
<E> javax.persistence.metamodel.ListAttribute<X,E> |
getDeclaredList(String name,
Class<E> elementType)
Returns the declared attribute of the given name, of type java.util.List and contains
the given element type.
|
javax.persistence.metamodel.MapAttribute<X,?,?> |
getDeclaredMap(String name)
Returns the declared attribute of the given name and of type java.util.Map.
|
<K,V> javax.persistence.metamodel.MapAttribute<X,K,V> |
getDeclaredMap(String name,
Class<K> keyType,
Class<V> valueType)
Returns the declared attribute of the given name, of type java.util.Map and contains
the given key/value type.
|
Set<javax.persistence.metamodel.PluralAttribute<X,?,?>> |
getDeclaredPluralAttributes()
Return all collection-valued attributes declared by the managed type.
|
javax.persistence.metamodel.SetAttribute<X,?> |
getDeclaredSet(String name)
Returns the declared attribute of the given name and of type java.util.Set.
|
<E> javax.persistence.metamodel.SetAttribute<X,E> |
getDeclaredSet(String name,
Class<E> elementType)
Returns the declared attribute of the given name, of type java.util.Set and contains
the given element type.
|
javax.persistence.metamodel.SingularAttribute<X,?> |
getDeclaredSingularAttribute(String name)
Returns the declared, single-valued attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.SingularAttribute<X,Y> |
getDeclaredSingularAttribute(String name,
Class<Y> type)
Returns the declared single-valued attribute of the given name and Java type.
|
Set<javax.persistence.metamodel.SingularAttribute<X,?>> |
getDeclaredSingularAttributes()
Returns the single-valued attributes declared by the managed type.
|
<Y> javax.persistence.metamodel.SingularAttribute<X,Y> |
getDeclaredVersion(Class<Y> type)
Returns the declared attribute of given type that corresponds to the version attribute of
this managed type.
|
<Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> |
getId(Class<Y> type)
Returns the attribute of given type that corresponds to the id attribute of this
identifiable managed type.
|
Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> |
getIdClassAttributes()
Returns the attributes corresponding to the id class of the identifiable type.
|
Class<X> |
getJavaType() |
javax.persistence.metamodel.ListAttribute<? super X,?> |
getList(String name)
Returns the attribute of the given name and of type java.util.List.
|
<E> javax.persistence.metamodel.ListAttribute<? super X,E> |
getList(String name,
Class<E> elementType)
Returns the attribute of the given name, of type java.util.List and contains the
given element type.
|
javax.persistence.metamodel.MapAttribute<? super X,?,?> |
getMap(String name)
Returns the attribute of the given name and of type java.util.Map.
|
<K,V> javax.persistence.metamodel.MapAttribute<? super X,K,V> |
getMap(String name,
Class<K> keyType,
Class<V> valueType)
Returns the attribute of the given name, of type java.util.Map and contains the
given key/value type.
|
Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> |
getPluralAttributes()
Returns all collection-valued attributes of the managed type.
|
javax.persistence.metamodel.SetAttribute<? super X,?> |
getSet(String name)
Returns the attribute of the given name and of type java.util.Set.
|
<E> javax.persistence.metamodel.SetAttribute<? super X,E> |
getSet(String name,
Class<E> elementType)
Returns the attribute of the given name, of type java.util.Set and contains the
given element type.
|
javax.persistence.metamodel.SingularAttribute<? super X,?> |
getSingularAttribute(String name)
Returns the single-valued attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> |
getSingularAttribute(String name,
Class<Y> type)
Returns the single-valued attribute of the given name and Java type.
|
Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> |
getSingularAttributes()
Returns the single-valued attributes of the managed type.
|
<Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> |
getVersion(Class<Y> type)
Returns the attribute of given type that corresponds to the version attribute of this
managed type.
|
static <T> T |
pick(Collection<T> original,
AbstractManagedType.Filter<T> f1,
AbstractManagedType.Filter<T> f2,
AbstractManagedType.Filter<T> f3,
AbstractManagedType.Filter<T> f4)
Applies chain of filters ANDed on the given collection to pick a single element.
|
String |
toString() |
public final MetamodelImpl model
public final ClassMetaData meta
public final Class<X> cls
protected AbstractManagedType(Class<X> cls, MetamodelImpl model)
public AbstractManagedType(ClassMetaData meta, MetamodelImpl model)
public Set<javax.persistence.metamodel.Attribute<? super X,?>> getAttributes()
getAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public Set<javax.persistence.metamodel.Attribute<X,?>> getDeclaredAttributes()
getDeclaredAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> getSingularAttributes()
getSingularAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public Set<javax.persistence.metamodel.SingularAttribute<X,?>> getDeclaredSingularAttributes()
getDeclaredSingularAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public <Y> javax.persistence.metamodel.Attribute<? super X,Y> getAttribute(String name, Class<Y> type)
IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> getSingularAttribute(String name, Class<Y> type)
getSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.Attribute<X,Y> getDeclaredAttribute(String name, Class<Y> type)
IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredSingularAttribute(String name, Class<Y> type)
getDeclaredSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> getPluralAttributes()
getPluralAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public Set<javax.persistence.metamodel.PluralAttribute<X,?,?>> getDeclaredPluralAttributes()
getDeclaredPluralAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public <E> javax.persistence.metamodel.CollectionAttribute<? super X,E> getCollection(String name, Class<E> elementType)
getCollection
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.SetAttribute<? super X,E> getSet(String name, Class<E> elementType)
getSet
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.ListAttribute<? super X,E> getList(String name, Class<E> elementType)
getList
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <K,V> javax.persistence.metamodel.MapAttribute<? super X,K,V> getMap(String name, Class<K> keyType, Class<V> valueType)
getMap
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.CollectionAttribute<X,E> getDeclaredCollection(String name, Class<E> elementType)
getDeclaredCollection
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.SetAttribute<X,E> getDeclaredSet(String name, Class<E> elementType)
getDeclaredSet
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.ListAttribute<X,E> getDeclaredList(String name, Class<E> elementType)
getDeclaredList
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic <K,V> javax.persistence.metamodel.MapAttribute<X,K,V> getDeclaredMap(String name, Class<K> keyType, Class<V> valueType)
getDeclaredMap
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.Attribute<? super X,?> getAttribute(String name)
getAttribute
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.Attribute<X,?> getDeclaredAttribute(String name)
getDeclaredAttribute
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SingularAttribute<? super X,?> getSingularAttribute(String name)
getSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SingularAttribute<X,?> getDeclaredSingularAttribute(String name)
getDeclaredSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.CollectionAttribute<? super X,?> getCollection(String name)
getCollection
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SetAttribute<? super X,?> getSet(String name)
getSet
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.ListAttribute<? super X,?> getList(String name)
getList
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.MapAttribute<? super X,?,?> getMap(String name)
getMap
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.CollectionAttribute<X,?> getDeclaredCollection(String name)
getDeclaredCollection
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SetAttribute<X,?> getDeclaredSet(String name)
getDeclaredSet
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.ListAttribute<X,?> getDeclaredList(String name)
getDeclaredList
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.MapAttribute<X,?,?> getDeclaredMap(String name)
getDeclaredMap
in interface javax.persistence.metamodel.ManagedType<X>
IllegalArgumentException
- if no such attribute existspublic final Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> getIdClassAttributes()
IllegalArgumentException
- if the this type is not using an id classpublic final <Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> getId(Class<Y> type)
IllegalArgumentException
- if no such attribute existspublic final <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredId(Class<Y> type)
IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> getVersion(Class<Y> type)
IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredVersion(Class<Y> type)
IllegalArgumentException
- if no such attribute existspublic static <T,C extends Collection<E>,E> C filter(Collection<T> original, C result, AbstractManagedType.Filter<T> f1, AbstractManagedType.Filter<T> f2, AbstractManagedType.Filter<T> f3, AbstractManagedType.Filter<T> f4)
public static <T> T pick(Collection<T> original, AbstractManagedType.Filter<T> f1, AbstractManagedType.Filter<T> f2, AbstractManagedType.Filter<T> f3, AbstractManagedType.Filter<T> f4)
public final Class<X> getJavaType()
getJavaType
in interface javax.persistence.metamodel.Type<X>
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.