From afc406a03bf58c38712ae3253cc16446449aad6d Mon Sep 17 00:00:00 2001 From: Ocean-Blue Date: Thu, 16 Jun 2011 12:36:10 -0700 Subject: [PATCH] Add comments to setDate, setTime, setTimestamp methods to reduce confusion to the Hibernate newbies in future. --- .../src/main/java/org/hibernate/Query.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/Query.java b/hibernate-core/src/main/java/org/hibernate/Query.java index d45f405619..5dc7249ce4 100644 --- a/hibernate-core/src/main/java/org/hibernate/Query.java +++ b/hibernate-core/src/main/java/org/hibernate/Query.java @@ -405,8 +405,28 @@ public interface Query { public Query setBigDecimal(String name, BigDecimal number); public Query setBigInteger(String name, BigInteger number); + /** + * Bind the date (time is truncated) of a given Date object to a named query parameter. + * + * @param name The name of the parameter + * @param date The date object + */ public Query setDate(String name, Date date); + + /** + * Bind the time (date is truncated) of a given Date object to a named query parameter. + * + * @param name The name of the parameter + * @param date The date object + */ public Query setTime(String name, Date date); + + /** + * Bind the date and the time of a given Date object to a named query parameter. + * + * @param name The name of the parameter + * @param date The date object + */ public Query setTimestamp(String name, Date date); public Query setCalendar(String name, Calendar calendar);