| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.persistence.meta.Types.BaseType<X>
org.apache.openjpa.persistence.meta.AbstractManagedType<X>
X - thepublic abstract class AbstractManagedType<X>
Implements the managed persistent type and its attributes. Provides identity and version attribute facilities for Identifiable type but does not implement it.
| Nested Class Summary | |
|---|---|
| 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> | 
| Nested classes/interfaces inherited from interface javax.persistence.metamodel.Type | 
|---|
| Type.PersistenceType | 
| Field Summary | |
|---|---|
|  ClassMetaData | meta | 
|  MetamodelImpl | model | 
| Fields inherited from class org.apache.openjpa.persistence.meta.Types.BaseType | 
|---|
| cls | 
| Constructor Summary | |
|---|---|
| protected  | AbstractManagedType(Class<X> cls,
                    MetamodelImpl model)A protected constructor for creating psudo-managed types. | 
|   | AbstractManagedType(ClassMetaData meta,
                    MetamodelImpl model)Construct a managed type. | 
| Method Summary | ||
|---|---|---|
| (package private)  void | assertType(String msg,
           FieldMetaData fmd,
           Class<?> actual,
           Class<?> expected) | |
| (package private) static
 | filter(Collection<T> original,
       C result,
       AbstractManagedType.Filter<T> f1) | |
| (package private) static
 | filter(Collection<T> original,
       C result,
       AbstractManagedType.Filter<T> f1,
       AbstractManagedType.Filter<T> f2) | |
| (package private) static
 | filter(Collection<T> original,
       C result,
       AbstractManagedType.Filter<T> f1,
       AbstractManagedType.Filter<T> f2,
       AbstractManagedType.Filter<T> f3) | |
| static
 | 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. | |
|  Attribute<? super X,?> | getAttribute(String name)Returns the attribute of the given name of any type. | |
| 
 | getAttribute(String name,
             Class<Y> type)Returns the attribute of the given name and Java type. | |
|  Set<Attribute<? super X,?>> | getAttributes()Returns all the attributes of the managed type including attributes of the super type. | |
|  CollectionAttribute<? super X,?> | getCollection(String name)Returns the attribute of the given name and of type java.util.Collection. | |
| 
 | getCollection(String name,
              Class<E> elementType)Returns the attribute of the given name, of type java.util.Collection and contains the given element type. | |
|  Attribute<X,?> | getDeclaredAttribute(String name)Returns the declared attribute of the given name of any type. | |
| 
 | getDeclaredAttribute(String name,
                     Class<Y> type)Returns the declared attribute of the given name and Java type. | |
|  Set<Attribute<X,?>> | getDeclaredAttributes()Returns all the attributes declared by this managed type only. | |
|  CollectionAttribute<X,?> | getDeclaredCollection(String name)Returns the declared attribute of the given name and of type java.util.Collection. | |
| 
 | 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. | |
| 
 | getDeclaredId(Class<Y> type)Returns the declared attribute of given type that corresponds to the id attribute of this identifiable managed type. | |
|  ListAttribute<X,?> | getDeclaredList(String name)Returns the declared attribute of the given name and of type java.util.List. | |
| 
 | 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. | |
|  MapAttribute<X,?,?> | getDeclaredMap(String name)Returns the declared attribute of the given name and of type java.util.Map. | |
| 
 | 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<PluralAttribute<X,?,?>> | getDeclaredPluralAttributes()Return all collection-valued attributes declared by the managed type. | |
|  SetAttribute<X,?> | getDeclaredSet(String name)Returns the declared attribute of the given name and of type java.util.Set. | |
| 
 | 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. | |
|  SingularAttribute<X,?> | getDeclaredSingularAttribute(String name)Returns the declared, single-valued attribute of the given name of any type. | |
| 
 | getDeclaredSingularAttribute(String name,
                             Class<Y> type)Returns the declared single-valued attribute of the given name and Java type. | |
|  Set<SingularAttribute<X,?>> | getDeclaredSingularAttributes()Returns the single-valued attributes declared by the managed type. | |
| 
 | getDeclaredVersion(Class<Y> type)Returns the declared attribute of given type that corresponds to the version attribute of this managed type. | |
| (package private)  FieldMetaData | getField(String name) | |
| (package private)  FieldMetaData | getField(String name,
         Class type) | |
| (package private)  FieldMetaData | getField(String name,
         Class<?> type,
         Class<?> elementType,
         Class<?> keyType,
         boolean decl)Get the field of the given name after validating the conditions. | |
| (package private)  FieldMetaData | getField(String name,
         Class type,
         boolean declaredOnly) | |
| 
 | getId(Class<Y> type)Returns the attribute of given type that corresponds to the id attribute of this identifiable managed type. | |
|  Set<SingularAttribute<? super X,?>> | getIdClassAttributes()Returns the attributes corresponding to the id class of the identifiable type. | |
|  ListAttribute<? super X,?> | getList(String name)Returns the attribute of the given name and of type java.util.List. | |
| 
 | getList(String name,
        Class<E> elementType)Returns the attribute of the given name, of type java.util.List and contains the given element type. | |
|  MapAttribute<? super X,?,?> | getMap(String name)Returns the attribute of the given name and of type java.util.Map. | |
| 
 | 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<PluralAttribute<? super X,?,?>> | getPluralAttributes()Returns all collection-valued attributes of the managed type. | |
|  SetAttribute<? super X,?> | getSet(String name)Returns the attribute of the given name and of type java.util.Set. | |
| 
 | getSet(String name,
       Class<E> elementType)Returns the attribute of the given name, of type java.util.Set and contains the given element type. | |
|  SingularAttribute<? super X,?> | getSingularAttribute(String name)Returns the single-valued attribute of the given name of any type. | |
| 
 | getSingularAttribute(String name,
                     Class<Y> type)Returns the single-valued attribute of the given name and Java type. | |
|  Set<SingularAttribute<? super X,?>> | getSingularAttributes()Returns the single-valued attributes of the managed type. | |
| 
 | getVersion(Class<Y> type)Returns the attribute of given type that corresponds to the version attribute of this managed type. | |
| (package private) static
 | pick(Collection<T> original,
     AbstractManagedType.Filter<T> f1) | |
| (package private) static
 | pick(Collection<T> original,
     AbstractManagedType.Filter<T> f1,
     AbstractManagedType.Filter<T> f2) | |
| (package private) static
 | pick(Collection<T> original,
     AbstractManagedType.Filter<T> f1,
     AbstractManagedType.Filter<T> f2,
     AbstractManagedType.Filter<T> f3) | |
| static
 | 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. | |
| (package private)  Class<?> | wrap(Class<?> c) | |
| Methods inherited from class org.apache.openjpa.persistence.meta.Types.BaseType | 
|---|
| getJavaType, 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 | 
|---|
public final MetamodelImpl model
public final ClassMetaData meta
| Constructor Detail | 
|---|
protected AbstractManagedType(Class<X> cls,
                              MetamodelImpl model)
public AbstractManagedType(ClassMetaData meta,
                           MetamodelImpl model)
| Method Detail | 
|---|
public Set<Attribute<? super X,?>> getAttributes()
getAttributes in interface ManagedType<X>public Set<Attribute<X,?>> getDeclaredAttributes()
getDeclaredAttributes in interface ManagedType<X>public Set<SingularAttribute<? super X,?>> getSingularAttributes()
getSingularAttributes in interface ManagedType<X>public Set<SingularAttribute<X,?>> getDeclaredSingularAttributes()
getDeclaredSingularAttributes in interface ManagedType<X>
public <Y> Attribute<? super X,Y> getAttribute(String name,
                                               Class<Y> type)
IllegalArgumentException - if no such attribute exists
public <Y> SingularAttribute<? super X,Y> getSingularAttribute(String name,
                                                               Class<Y> type)
getSingularAttribute in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <Y> Attribute<X,Y> getDeclaredAttribute(String name,
                                               Class<Y> type)
IllegalArgumentException - if no such attribute exists
public <Y> SingularAttribute<X,Y> getDeclaredSingularAttribute(String name,
                                                               Class<Y> type)
getDeclaredSingularAttribute in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic Set<PluralAttribute<? super X,?,?>> getPluralAttributes()
getPluralAttributes in interface ManagedType<X>public Set<PluralAttribute<X,?,?>> getDeclaredPluralAttributes()
getDeclaredPluralAttributes in interface ManagedType<X>
public <E> CollectionAttribute<? super X,E> getCollection(String name,
                                                          Class<E> elementType)
getCollection in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <E> SetAttribute<? super X,E> getSet(String name,
                                            Class<E> elementType)
getSet in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <E> ListAttribute<? super X,E> getList(String name,
                                              Class<E> elementType)
getList in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <K,V> MapAttribute<? super X,K,V> getMap(String name,
                                                Class<K> keyType,
                                                Class<V> valueType)
getMap in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <E> CollectionAttribute<X,E> getDeclaredCollection(String name,
                                                          Class<E> elementType)
getDeclaredCollection in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <E> SetAttribute<X,E> getDeclaredSet(String name,
                                            Class<E> elementType)
getDeclaredSet in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <E> ListAttribute<X,E> getDeclaredList(String name,
                                              Class<E> elementType)
getDeclaredList in interface ManagedType<X>IllegalArgumentException - if no such attribute exists
public <K,V> MapAttribute<X,K,V> getDeclaredMap(String name,
                                                Class<K> keyType,
                                                Class<V> valueType)
getDeclaredMap in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic Attribute<? super X,?> getAttribute(String name)
getAttribute in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic Attribute<X,?> getDeclaredAttribute(String name)
getDeclaredAttribute in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic SingularAttribute<? super X,?> getSingularAttribute(String name)
getSingularAttribute in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic SingularAttribute<X,?> getDeclaredSingularAttribute(String name)
getDeclaredSingularAttribute in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic CollectionAttribute<? super X,?> getCollection(String name)
getCollection in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic SetAttribute<? super X,?> getSet(String name)
getSet in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic ListAttribute<? super X,?> getList(String name)
getList in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic MapAttribute<? super X,?,?> getMap(String name)
getMap in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic CollectionAttribute<X,?> getDeclaredCollection(String name)
getDeclaredCollection in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic SetAttribute<X,?> getDeclaredSet(String name)
getDeclaredSet in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic ListAttribute<X,?> getDeclaredList(String name)
getDeclaredList in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic MapAttribute<X,?,?> getDeclaredMap(String name)
getDeclaredMap in interface ManagedType<X>IllegalArgumentException - if no such attribute existspublic final Set<SingularAttribute<? super X,?>> getIdClassAttributes()
IllegalArgumentException - if the this type is not using an id classpublic final <Y> SingularAttribute<? super X,Y> getId(Class<Y> type)
IllegalArgumentException - if no such attribute existspublic final <Y> SingularAttribute<X,Y> getDeclaredId(Class<Y> type)
IllegalArgumentException - if no such attribute existspublic <Y> SingularAttribute<? super X,Y> getVersion(Class<Y> type)
IllegalArgumentException - if no such attribute existspublic <Y> SingularAttribute<X,Y> getDeclaredVersion(Class<Y> type)
IllegalArgumentException - if no such attribute existsFieldMetaData getField(String name)
FieldMetaData getField(String name,
                       Class type)
FieldMetaData getField(String name,
                       Class type,
                       boolean declaredOnly)
FieldMetaData getField(String name,
                       Class<?> type,
                       Class<?> elementType,
                       Class<?> keyType,
                       boolean decl)
name - simple name i.e. without the class nametype - the expected type of the field.element - the expected element type of the field.key - the expected key type of the field.declared - is this field declared in this receiver
IllegalArgumentException - if any of the validation fails.
void assertType(String msg,
                FieldMetaData fmd,
                Class<?> actual,
                Class<?> expected)
Class<?> wrap(Class<?> c)
public 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)
static <T,C extends Collection<E>,E> C filter(Collection<T> original,
                                              C result,
                                              AbstractManagedType.Filter<T> f1)
static <T,C extends Collection<E>,E> C filter(Collection<T> original,
                                              C result,
                                              AbstractManagedType.Filter<T> f1,
                                              AbstractManagedType.Filter<T> f2)
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)
static <T> T pick(Collection<T> original,
                  AbstractManagedType.Filter<T> f1)
static <T> T pick(Collection<T> original,
                  AbstractManagedType.Filter<T> f1,
                  AbstractManagedType.Filter<T> f2)
static <T> T pick(Collection<T> original,
                  AbstractManagedType.Filter<T> f1,
                  AbstractManagedType.Filter<T> f2,
                  AbstractManagedType.Filter<T> f3)
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||