1 21 package net.mlw.vlh.adapter.hibernate.util.setter; 22 23 import java.text.ParseException ; 24 25 import net.sf.hibernate.HibernateException; 26 import net.sf.hibernate.Query; 27 28 import org.apache.commons.logging.Log; 29 import org.apache.commons.logging.LogFactory; 30 31 37 public class DefaultSetter extends AbstractSetter 38 { 39 42 private static final Log LOGGER = LogFactory.getLog(DefaultSetter.class); 43 44 47 public void set(Query query, String key, Object value) throws HibernateException, ParseException 48 { 49 if (LOGGER.isInfoEnabled()) 50 { 51 LOGGER.info("The key='" + key + "' was set to the query as the parameter='" + value + "'."); 52 } 53 query.setParameter(key, value); 54 } 55 } | Popular Tags |