net.mlw.vlh.adapter.hibernate3.util.setter
Class DateSetter

java.lang.Object
  extended bynet.mlw.vlh.adapter.hibernate3.util.setter.AbstractSetter
      extended bynet.mlw.vlh.adapter.hibernate3.util.setter.DateSetter
All Implemented Interfaces:
Setter

public class DateSetter
extends AbstractSetter

Version:
$Revision: 1.2 $ $Date: 2005/11/03 18:08:51 $
Author:
Andrej Zachar, Matthew L. Wilson

Field Summary
static String DEFAULT_FORMAT
           
 
Constructor Summary
DateSetter()
           
 
Method Summary
 void set(org.hibernate.Query query, String key, Object value)
           If is value instance of the String, it try to parse value using SimpleDateFormat with specified format. If is value instance of the Date, it will set it directly to query .
 void setFormat(String format)
          Set the format for parsing Date from string values of keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FORMAT

public static final String DEFAULT_FORMAT
See Also:
Constant Field Values
Constructor Detail

DateSetter

public DateSetter()
Method Detail

set

public void set(org.hibernate.Query query,
                String key,
                Object value)
         throws org.hibernate.HibernateException,
                ParseException
  1. If is value instance of the String, it try to parse value using SimpleDateFormat with specified format.
  2. If is value instance of the Date, it will set it directly to query .
  3. Otherwise it will set null to query for key.

Parameters:
query - The Hiberante Query.
key - The name of the argument
value - The value to be set
Throws:
ParseException - If an error occurs.
org.hibernate.HibernateException
See Also:
Setter.set(org.hibernate.Query, java.lang.String, java.lang.Object), setFormat(String)

setFormat

public void setFormat(String format)
Set the format for parsing Date from string values of keys. Default is "MM/dd/yyyy"

Parameters:
format - The format to set.


Copyright © 2003-2006 mlavilson. All Rights Reserved.