[hibernate-commits] Hibernate SVN: r17733 - jpa-api/trunk/src/main/java/javax/persistence/metamodel.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Oct 13 16:56:35 EDT 2009
Author: steve.ebersole at jboss.com
Date: 2009-10-13 16:56:34 -0400 (Tue, 13 Oct 2009)
New Revision: 17733
Modified:
jpa-api/trunk/src/main/java/javax/persistence/metamodel/IdentifiableType.java
jpa-api/trunk/src/main/java/javax/persistence/metamodel/ManagedType.java
Log:
validated javax.persistence.metamodel package definitions against spec version dated 2009.31.08
Modified: jpa-api/trunk/src/main/java/javax/persistence/metamodel/IdentifiableType.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/metamodel/IdentifiableType.java 2009-10-13 19:59:53 UTC (rev 17732)
+++ jpa-api/trunk/src/main/java/javax/persistence/metamodel/IdentifiableType.java 2009-10-13 20:56:34 UTC (rev 17733)
@@ -19,25 +19,12 @@
* @return id attribute
*
* @throws IllegalArgumentException if id attribute of the given
- * type is not present in the identifiable type or if
- * the identifiable type has an id class
+ * type is not present in the identifiable type or if
+ * the identifiable type has an id class
*/
<Y> SingularAttribute<? super X, Y> getId(Class<Y> type);
/**
- * Return the attribute that corresponds to the version
- * attribute of the entity or mapped superclass.
- *
- * @param type the type of the represented version attribute
- *
- * @return version attribute
- *
- * @throws IllegalArgumentException if version attribute of the
- * given type is not present in the identifiable type
- */
- <Y> SingularAttribute<? super X, Y> getVersion(Class<Y> type);
-
- /**
* Return the attribute that corresponds to the id attribute
* declared by the entity or mapped superclass.
*
@@ -46,13 +33,26 @@
* @return declared id attribute
*
* @throws IllegalArgumentException if id attribute of the given
- * type is not declared in the identifiable type or if
- * the identifiable type has an id class
+ * type is not declared in the identifiable type or if
+ * the identifiable type has an id class
*/
<Y> SingularAttribute<X, Y> getDeclaredId(Class<Y> type);
/**
* Return the attribute that corresponds to the version
+ * attribute of the entity or mapped superclass.
+ *
+ * @param type the type of the represented version attribute
+ *
+ * @return version attribute
+ *
+ * @throws IllegalArgumentException if version attribute of the
+ * given type is not present in the identifiable type
+ */
+ <Y> SingularAttribute<? super X, Y> getVersion(Class<Y> type);
+
+ /**
+ * Return the attribute that corresponds to the version
* attribute declared by the entity or mapped superclass.
*
* @param type the type of the represented declared version
@@ -61,7 +61,7 @@
* @return declared version attribute
*
* @throws IllegalArgumentException if version attribute of the
- * type is not declared in the identifiable type
+ * type is not declared in the identifiable type
*/
<Y> SingularAttribute<X, Y> getDeclaredVersion(Class<Y> type);
@@ -80,7 +80,7 @@
* for an idclass.
*
* @return boolean indicating whether or not the identifiable
- * type has a single id attribute
+ * type has a single id attribute
*/
boolean hasSingleIdAttribute();
@@ -88,7 +88,7 @@
* Whether or not the identifiable type has a version attribute.
*
* @return boolean indicating whether or not the identifiable
- * type has a version attribute
+ * type has a version attribute
*/
boolean hasVersionAttribute();
@@ -99,7 +99,7 @@
* @return id attributes
*
* @throws IllegalArgumentException if the identifiable type
- * does not have an id class
+ * does not have an id class
*/
java.util.Set<SingularAttribute<? super X, ?>> getIdClassAttributes();
Modified: jpa-api/trunk/src/main/java/javax/persistence/metamodel/ManagedType.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/metamodel/ManagedType.java 2009-10-13 19:59:53 UTC (rev 17732)
+++ jpa-api/trunk/src/main/java/javax/persistence/metamodel/ManagedType.java 2009-10-13 20:56:34 UTC (rev 17733)
@@ -12,11 +12,16 @@
/**
* Return the attributes of the managed type.
+ *
+ * @return The type's attributes
*/
java.util.Set<Attribute<? super X, ?>> getAttributes();
/**
* Return the attributes declared by the managed type.
+ * Returns empty set if the managed type has no declared attributes.
+ *
+ * @return The type's declared attributes, or empty set representing none.
*/
java.util.Set<Attribute<X, ?>> getDeclaredAttributes();
@@ -53,14 +58,15 @@
/**
* 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
*/
java.util.Set<SingularAttribute<? super X, ?>> getSingularAttributes();
/**
- * Return the single-valued attributes declared by the managed
- * type.
+ * 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
*/
@@ -83,86 +89,67 @@
<E> CollectionAttribute<? super X, E> getCollection(String name, Class<E> elementType);
/**
- * Return the Set-valued attribute of the managed type that
- * corresponds to the specified name and Java element type.
+ * Return the Collection-valued attribute declared by the
+ * managed type that corresponds to the specified name and Java
+ * element type.
*
* @param name the name of the represented attribute
* @param elementType the element type of the represented
* attribute
*
- * @return SetAttribute of the given name and element type
+ * @return declared 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
+ * name and type is not declared in the managed type
*/
- <E> SetAttribute<? super X, E> getSet(String name, Class<E> elementType);
+ <E> CollectionAttribute<X, E> getDeclaredCollection(String name, Class<E> elementType);
/**
- * Return the List-valued attribute of the managed type that
+ * Return the Set-valued attribute of the managed type that
* corresponds to the specified name and Java element type.
*
* @param name the name of the represented attribute
* @param elementType the element type of the represented
* attribute
*
- * @return ListAttribute of the given name and element type
+ * @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
*/
- <E> ListAttribute<? super X, E> getList(String name, Class<E> elementType);
+ <E> SetAttribute<? super X, E> getSet(String name, Class<E> elementType);
/**
- * Return the Map-valued attribute of the managed type that
- * corresponds to the specified name and Java key and value
- * types.
+ * Return the Set-valued attribute declared by the managed type
+ * that corresponds to the specified name and Java element type.
*
* @param name the name of the represented attribute
- * @param keyType the key type of the represented attribute
- * @param 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
- */
- <K, V> MapAttribute<? super X, K, V> getMap(String name,
- Class<K> keyType,
- Class<V> valueType);
-
- /**
- * Return the Collection-valued attribute declared by the
- * managed type that corresponds to the specified name and Java
- * element type.
- *
- * @param name the name of the represented attribute
* @param elementType the element type of the represented
* attribute
*
- * @return declared CollectionAttribute of the given name and
+ * @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
*/
- <E> CollectionAttribute<X, E> getDeclaredCollection(String name, Class<E> elementType);
+ <E> 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.
+ * Return the List-valued attribute of the managed type that
+ * corresponds to the specified name and Java element type.
*
* @param name the name of the represented attribute
* @param elementType the element type of the represented
* attribute
*
- * @return declared SetAttribute of the given name and
- * element type
+ * @return 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
+ * name and type is not present in the managed type
*/
- <E> SetAttribute<X, E> getDeclaredSet(String name, Class<E> elementType);
+ <E> ListAttribute<? super X, E> getList(String name, Class<E> elementType);
/**
* Return the List-valued attribute declared by the managed
@@ -182,6 +169,25 @@
<E> ListAttribute<X, E> getDeclaredList(String name, Class<E> elementType);
/**
+ * Return the Map-valued attribute of the managed type that
+ * corresponds to the specified name and Java key and value
+ * types.
+ *
+ * @param name the name of the represented attribute
+ * @param keyType the key type of the represented attribute
+ * @param 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
+ */
+ <K, V> MapAttribute<? super X, K, V> getMap(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.
@@ -201,19 +207,26 @@
Class<V> valueType);
/**
- * Return all collection-valued attributes of the managed type.
+ * 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 valued attributes
+ * @return Collection-, Set-, List-, and Map-valued attributes
*/
- java.util.Set<PluralAttribute<? super X, ?, ?>> getCollections();
+ java.util.Set<PluralAttribute<? super X, ?, ?>> getPluralAttributes();
/**
- * Return all collection-valued attributes declared by the
+ * 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 valued attributes
+ * @return declared Collection-, Set-, List-, and Map-valued
+ * attributes
*/
- java.util.Set<PluralAttribute<X, ?, ?>> getDeclaredCollections();
+ java.util.Set<PluralAttribute<X, ?, ?>> getDeclaredPluralAttributes();
//String-based:
@@ -285,82 +298,82 @@
CollectionAttribute<? super X, ?> getCollection(String name);
/**
- * Return the Set-valued attribute of the managed type that
- * corresponds to the specified name.
+ * Return the Collection-valued attribute declared by the
+ * managed type that corresponds to the specified name.
*
* @param name the name of the represented attribute
*
- * @return SetAttribute of the given name
+ * @return declared CollectionAttribute of the given name
*
* @throws IllegalArgumentException if attribute of the given
- * name is not present in the managed type
+ * name is not declared in the managed type
*/
- SetAttribute<? super X, ?> getSet(String name);
+ CollectionAttribute<X, ?> getDeclaredCollection(String name);
/**
- * Return the List-valued attribute of the managed type that
+ * Return the Set-valued attribute of the managed type that
* corresponds to the specified name.
*
* @param name the name of the represented attribute
*
- * @return ListAttribute of the given name
+ * @return SetAttribute of the given name
*
* @throws IllegalArgumentException if attribute of the given
* name is not present in the managed type
*/
- ListAttribute<? super X, ?> getList(String name);
+ SetAttribute<? super X, ?> getSet(String name);
/**
- * Return the Map-valued attribute of the managed type that
- * corresponds to the specified name.
+ * Return the Set-valued attribute declared by the managed type
+ * that corresponds to the specified name.
*
* @param name the name of the represented attribute
*
- * @return MapAttribute of the given name
+ * @return declared SetAttribute of the given name
*
* @throws IllegalArgumentException if attribute of the given
- * name is not present in the managed type
+ * name is not declared in the managed type
*/
- MapAttribute<? super X, ?, ?> getMap(String name);
+ SetAttribute<X, ?> getDeclaredSet(String name);
/**
- * Return the Collection-valued attribute declared by the
- * managed type that corresponds to the specified name.
+ * Return the List-valued attribute of the managed type that
+ * corresponds to the specified name.
*
* @param name the name of the represented attribute
*
- * @return declared CollectionAttribute of the given name
+ * @return ListAttribute of the given name
*
* @throws IllegalArgumentException if attribute of the given
- * name is not declared in the managed type
+ * name is not present in the managed type
*/
- CollectionAttribute<X, ?> getDeclaredCollection(String name);
+ ListAttribute<? super X, ?> getList(String name);
/**
- * Return the Set-valued attribute declared by the managed type
- * that corresponds to the specified name.
+ * Return the List-valued attribute declared by the managed
+ * type that corresponds to the specified name.
*
* @param name the name of the represented attribute
*
- * @return declared SetAttribute of the given name
+ * @return declared ListAttribute of the given name
*
* @throws IllegalArgumentException if attribute of the given
* name is not declared in the managed type
*/
- SetAttribute<X, ?> getDeclaredSet(String name);
+ ListAttribute<X, ?> getDeclaredList(String name);
/**
- * Return the List-valued attribute declared by the managed
- * type that corresponds to the specified name.
+ * Return the Map-valued attribute of the managed type that
+ * corresponds to the specified name.
*
* @param name the name of the represented attribute
*
- * @return declared ListAttribute of the given name
+ * @return MapAttribute of the given name
*
* @throws IllegalArgumentException if attribute of the given
- * name is not declared in the managed type
+ * name is not present in the managed type
*/
- ListAttribute<X, ?> getDeclaredList(String name);
+ MapAttribute<? super X, ?, ?> getMap(String name);
/**
* Return the Map-valued attribute declared by the managed
More information about the hibernate-commits
mailing list