net.mlw.vlh.adapter.hibernate.util.setter
Class DateSetter
java.lang.Object
net.mlw.vlh.adapter.hibernate.util.setter.AbstractSetter
net.mlw.vlh.adapter.hibernate.util.setter.DateSetter
- All Implemented Interfaces:
- Setter
- public class DateSetter
- extends AbstractSetter
- Version:
- $Revision: 1.3 $ $Date: 2005/09/26 09:25:31 $
- Author:
- Andrej Zachar, Matthew L. Wilson
Method Summary |
void |
set(net.sf.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 |
DEFAULT_FORMAT
public static final String DEFAULT_FORMAT
- See Also:
- Constant Field Values
DateSetter
public DateSetter()
set
public void set(net.sf.hibernate.Query query,
String key,
Object value)
throws net.sf.hibernate.HibernateException,
ParseException
- 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 .
- Otherwise it will set null to query for key.
- Parameters:
query
- The Hiberante Query.key
- The name of the argumentvalue
- The value to be set
- Throws:
ParseException
- If an error occurs.
net.sf.hibernate.HibernateException
- See Also:
Setter.set(net.sf.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.