[hibernate-commits] Hibernate SVN: r10590 - branches/Branch_3_2/Hibernate3/src/org/hibernate

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Oct 17 04:57:23 EDT 2006


Author: max.andersen at jboss.com
Date: 2006-10-17 04:57:22 -0400 (Tue, 17 Oct 2006)
New Revision: 10590

Modified:
   branches/Branch_3_2/Hibernate3/src/org/hibernate/Query.java
Log:
missing commit of Query for HHH-2037 
+ updated docs for setParameter regarding how parameter types are guessed/determined.

Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/Query.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/Query.java	2006-10-16 15:47:37 UTC (rev 10589)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/Query.java	2006-10-17 08:57:22 UTC (rev 10590)
@@ -10,6 +10,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 
 import org.hibernate.transform.ResultTransformer;
 import org.hibernate.type.Type;
@@ -226,8 +227,9 @@
 	public Query setParameter(String name, Object val, Type type);
 
 	/**
-	 * Bind a value to a JDBC-style query parameter, guessing the
-	 * Hibernate type from the class of the given object.
+	 * Bind a value to a JDBC-style query parameter. The Hibernate type of the parameter is
+	 * first detected via the usage/position in the query and if not sufficient secondly 
+	 * guessed from the class of the given object.
 	 * @param position the position of the parameter in the query
 	 * string, numbered from <tt>0</tt>.
 	 * @param val the non-null parameter value
@@ -235,8 +237,9 @@
 	 */
 	public Query setParameter(int position, Object val) throws HibernateException;
 	/**
-	 * Bind a value to a named query parameter, guessing the Hibernate
-	 * type from the class of the given object.
+	 * Bind a value to a named query parameter. The Hibernate type of the parameter is
+	 * first detected via the usage/position in the query and if not sufficient secondly 
+	 * guessed from the class of the given object.
 	 * @param name the name of the parameter
 	 * @param val the non-null parameter value
 	 * @throws org.hibernate.HibernateException if no type could be determined
@@ -258,8 +261,9 @@
 	public Query setParameterList(String name, Collection vals, Type type) throws HibernateException;
 
 	/**
-	 * Bind multiple values to a named query parameter, guessing the Hibernate type from the
-	 * class of the first object in the collection. This is useful for binding a list of values
+	 * Bind multiple values to a named query parameter. The Hibernate type of the parameter is
+	 * first detected via the usage/position in the query and if not sufficient secondly 
+	 * guessed from the class of the first object in the collection. This is useful for binding a list of values
 	 * to an expression such as <tt>foo.bar in (:value_list)</tt>.
 	 * @param name the name of the parameter
 	 * @param vals a collection of values to list
@@ -276,8 +280,9 @@
 	public Query setParameterList(String name, Object[] vals, Type type) throws HibernateException;
 
 	/**
-	 * Bind multiple values to a named query parameter, guessing the Hibernate type from the
-	 * class of the first object in the array. This is useful for binding a list of values
+	 * Bind multiple values to a named query parameter. The Hibernate type of the parameter is
+	 * first detected via the usage/position in the query and if not sufficient secondly 
+	 * guessed from the class of the first object in the array. This is useful for binding a list of values
 	 * to an expression such as <tt>foo.bar in (:value_list)</tt>.
 	 * @param name the name of the parameter
 	 * @param vals a collection of values to list
@@ -289,8 +294,17 @@
 	 * matching property names with parameter names and mapping property types to
 	 * Hibernate types using hueristics.
 	 * @param bean any JavaBean or POJO
+	 */	
+	public Query setProperties(Object bean) throws HibernateException;
+	
+	/**
+	 * Bind the values of the given Map for each named parameters of the query,
+	 * matching key names with parameter names and mapping value types to
+	 * Hibernate types using hueristics.
+	 * @param bean a java.util.Map
 	 */
-	public Query setProperties(Object bean) throws HibernateException;
+	public Query setProperties(Map bean) throws HibernateException;
+	
 
 	public Query setString(int position, String val);
 	public Query setCharacter(int position, char val);




More information about the hibernate-commits mailing list