se.unlogic.standardutils.dao
Class PreparedStatementQueryMethods

java.lang.Object
  extended by se.unlogic.standardutils.dao.PreparedStatementQueryMethods

public class PreparedStatementQueryMethods
extends java.lang.Object

This class provides a static map containing mappings from classes to their corresponding set methods in the PreparedStatement interface.

Integer, Long, Double, Float, Boolean and Byte types are mapped to the setObject method in order to allow null values.

All other types are mapped to their default set method in the PreparedStatement interface.

Author:
Robert "Unlogic" Olofsson (unlogic@unlogic.se)

Field Summary
protected static java.util.HashMap<java.lang.Class<?>,java.lang.reflect.Method> QUERY_METHOD_MAP
           
protected static java.lang.reflect.Method SET_OBJECT_METHOD
           
 
Constructor Summary
PreparedStatementQueryMethods()
           
 
Method Summary
static java.lang.reflect.Method getObjectQueryMethod()
           
static java.lang.reflect.Method getQueryMethod(java.lang.Class<?> clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_METHOD_MAP

protected static final java.util.HashMap<java.lang.Class<?>,java.lang.reflect.Method> QUERY_METHOD_MAP

SET_OBJECT_METHOD

protected static final java.lang.reflect.Method SET_OBJECT_METHOD
Constructor Detail

PreparedStatementQueryMethods

public PreparedStatementQueryMethods()
Method Detail

getQueryMethod

public static java.lang.reflect.Method getQueryMethod(java.lang.Class<?> clazz)

getObjectQueryMethod

public static java.lang.reflect.Method getObjectQueryMethod()


Copyright © 2011. All Rights Reserved.