org.apache.openjpa.persistence.meta
X
- thepublic abstract class AbstractManagedType<X> extends java.lang.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 |
---|---|
java.lang.Class<X> |
cls |
ClassMetaData |
meta |
MetamodelImpl |
model |
Modifier | Constructor and Description |
---|---|
protected |
AbstractManagedType(java.lang.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 java.util.Collection<E>,E> |
filter(java.util.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(java.lang.String name)
Returns the attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.Attribute<? super X,Y> |
getAttribute(java.lang.String name,
java.lang.Class<Y> type)
Returns the attribute of the given name and Java type.
|
java.util.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(java.lang.String name)
Returns the attribute of the given name and of type java.util.Collection.
|
<E> javax.persistence.metamodel.CollectionAttribute<? super X,E> |
getCollection(java.lang.String name,
java.lang.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(java.lang.String name)
Returns the declared attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.Attribute<X,Y> |
getDeclaredAttribute(java.lang.String name,
java.lang.Class<Y> type)
Returns the declared attribute of the given name and Java type.
|
java.util.Set<javax.persistence.metamodel.Attribute<X,?>> |
getDeclaredAttributes()
Returns all the attributes declared by this managed type only.
|
javax.persistence.metamodel.CollectionAttribute<X,?> |
getDeclaredCollection(java.lang.String name)
Returns the declared attribute of the given name and of type java.util.Collection.
|
<E> javax.persistence.metamodel.CollectionAttribute<X,E> |
getDeclaredCollection(java.lang.String name,
java.lang.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(java.lang.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(java.lang.String name)
Returns the declared attribute of the given name and of type java.util.List.
|
<E> javax.persistence.metamodel.ListAttribute<X,E> |
getDeclaredList(java.lang.String name,
java.lang.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(java.lang.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(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Returns the declared attribute of the given name, of type java.util.Map and contains
the given key/value type.
|
java.util.Set<javax.persistence.metamodel.PluralAttribute<X,?,?>> |
getDeclaredPluralAttributes()
Return all collection-valued attributes declared by the managed type.
|
javax.persistence.metamodel.SetAttribute<X,?> |
getDeclaredSet(java.lang.String name)
Returns the declared attribute of the given name and of type java.util.Set.
|
<E> javax.persistence.metamodel.SetAttribute<X,E> |
getDeclaredSet(java.lang.String name,
java.lang.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(java.lang.String name)
Returns the declared, single-valued attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.SingularAttribute<X,Y> |
getDeclaredSingularAttribute(java.lang.String name,
java.lang.Class<Y> type)
Returns the declared single-valued attribute of the given name and Java type.
|
java.util.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(java.lang.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(java.lang.Class<Y> type)
Returns the attribute of given type that corresponds to the id attribute of this
identifiable managed type.
|
java.util.Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> |
getIdClassAttributes()
Returns the attributes corresponding to the id class of the identifiable type.
|
java.lang.Class<X> |
getJavaType() |
javax.persistence.metamodel.ListAttribute<? super X,?> |
getList(java.lang.String name)
Returns the attribute of the given name and of type java.util.List.
|
<E> javax.persistence.metamodel.ListAttribute<? super X,E> |
getList(java.lang.String name,
java.lang.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(java.lang.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(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Returns the attribute of the given name, of type java.util.Map and contains the
given key/value type.
|
java.util.Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> |
getPluralAttributes()
Returns all collection-valued attributes of the managed type.
|
javax.persistence.metamodel.SetAttribute<? super X,?> |
getSet(java.lang.String name)
Returns the attribute of the given name and of type java.util.Set.
|
<E> javax.persistence.metamodel.SetAttribute<? super X,E> |
getSet(java.lang.String name,
java.lang.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(java.lang.String name)
Returns the single-valued attribute of the given name of any type.
|
<Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> |
getSingularAttribute(java.lang.String name,
java.lang.Class<Y> type)
Returns the single-valued attribute of the given name and Java type.
|
java.util.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(java.lang.Class<Y> type)
Returns the attribute of given type that corresponds to the version attribute of this
managed type.
|
static <T> T |
pick(java.util.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.
|
java.lang.String |
toString() |
public final MetamodelImpl model
public final ClassMetaData meta
public final java.lang.Class<X> cls
protected AbstractManagedType(java.lang.Class<X> cls, MetamodelImpl model)
public AbstractManagedType(ClassMetaData meta, MetamodelImpl model)
public java.util.Set<javax.persistence.metamodel.Attribute<? super X,?>> getAttributes()
getAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public java.util.Set<javax.persistence.metamodel.Attribute<X,?>> getDeclaredAttributes()
getDeclaredAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public java.util.Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> getSingularAttributes()
getSingularAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public java.util.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(java.lang.String name, java.lang.Class<Y> type)
java.lang.IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> getSingularAttribute(java.lang.String name, java.lang.Class<Y> type)
getSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.Attribute<X,Y> getDeclaredAttribute(java.lang.String name, java.lang.Class<Y> type)
java.lang.IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredSingularAttribute(java.lang.String name, java.lang.Class<Y> type)
getDeclaredSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic java.util.Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> getPluralAttributes()
getPluralAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public java.util.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(java.lang.String name, java.lang.Class<E> elementType)
getCollection
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.SetAttribute<? super X,E> getSet(java.lang.String name, java.lang.Class<E> elementType)
getSet
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.ListAttribute<? super X,E> getList(java.lang.String name, java.lang.Class<E> elementType)
getList
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <K,V> javax.persistence.metamodel.MapAttribute<? super X,K,V> getMap(java.lang.String name, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
getMap
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.CollectionAttribute<X,E> getDeclaredCollection(java.lang.String name, java.lang.Class<E> elementType)
getDeclaredCollection
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.SetAttribute<X,E> getDeclaredSet(java.lang.String name, java.lang.Class<E> elementType)
getDeclaredSet
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <E> javax.persistence.metamodel.ListAttribute<X,E> getDeclaredList(java.lang.String name, java.lang.Class<E> elementType)
getDeclaredList
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic <K,V> javax.persistence.metamodel.MapAttribute<X,K,V> getDeclaredMap(java.lang.String name, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
getDeclaredMap
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.Attribute<? super X,?> getAttribute(java.lang.String name)
getAttribute
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.Attribute<X,?> getDeclaredAttribute(java.lang.String name)
getDeclaredAttribute
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SingularAttribute<? super X,?> getSingularAttribute(java.lang.String name)
getSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SingularAttribute<X,?> getDeclaredSingularAttribute(java.lang.String name)
getDeclaredSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.CollectionAttribute<? super X,?> getCollection(java.lang.String name)
getCollection
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SetAttribute<? super X,?> getSet(java.lang.String name)
getSet
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.ListAttribute<? super X,?> getList(java.lang.String name)
getList
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.MapAttribute<? super X,?,?> getMap(java.lang.String name)
getMap
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.CollectionAttribute<X,?> getDeclaredCollection(java.lang.String name)
getDeclaredCollection
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.SetAttribute<X,?> getDeclaredSet(java.lang.String name)
getDeclaredSet
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.ListAttribute<X,?> getDeclaredList(java.lang.String name)
getDeclaredList
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic javax.persistence.metamodel.MapAttribute<X,?,?> getDeclaredMap(java.lang.String name)
getDeclaredMap
in interface javax.persistence.metamodel.ManagedType<X>
java.lang.IllegalArgumentException
- if no such attribute existspublic final java.util.Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> getIdClassAttributes()
java.lang.IllegalArgumentException
- if the this type is not using an id classpublic final <Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> getId(java.lang.Class<Y> type)
java.lang.IllegalArgumentException
- if no such attribute existspublic final <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredId(java.lang.Class<Y> type)
java.lang.IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<? super X,Y> getVersion(java.lang.Class<Y> type)
java.lang.IllegalArgumentException
- if no such attribute existspublic <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredVersion(java.lang.Class<Y> type)
java.lang.IllegalArgumentException
- if no such attribute existspublic static <T,C extends java.util.Collection<E>,E> C filter(java.util.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(java.util.Collection<T> original, AbstractManagedType.Filter<T> f1, AbstractManagedType.Filter<T> f2, AbstractManagedType.Filter<T> f3, AbstractManagedType.Filter<T> f4)
public final java.lang.Class<X> getJavaType()
getJavaType
in interface javax.persistence.metamodel.Type<X>
public java.lang.String toString()
toString
in class java.lang.Object