commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r916835 [12/41] - in /websites/production/commons/content/proper/commons-dbutils: ./ apidocs/ apidocs/org/apache/commons/dbutils/ apidocs/org/apache/commons/dbutils/class-use/ apidocs/org/apache/commons/dbutils/handlers/ apidocs/org/apache/...
Date Sun, 20 Jul 2014 08:52:25 GMT
Modified: websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/BeanProcessor.html
==============================================================================
--- websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/BeanProcessor.html (original)
+++ websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/BeanProcessor.html Sun Jul 20 08:52:20 2014
@@ -229,287 +229,296 @@
 <span class="sourceLineNo">221</span>            PropertyDescriptor prop = props[columnToProperty[i]];<a name="line.221"></a>
 <span class="sourceLineNo">222</span>            Class&lt;?&gt; propType = prop.getPropertyType();<a name="line.222"></a>
 <span class="sourceLineNo">223</span><a name="line.223"></a>
-<span class="sourceLineNo">224</span>            Object value = this.processColumn(rs, i, propType);<a name="line.224"></a>
-<span class="sourceLineNo">225</span><a name="line.225"></a>
-<span class="sourceLineNo">226</span>            if (propType != null &amp;&amp; value == null &amp;&amp; propType.isPrimitive()) {<a name="line.226"></a>
-<span class="sourceLineNo">227</span>                value = primitiveDefaults.get(propType);<a name="line.227"></a>
-<span class="sourceLineNo">228</span>            }<a name="line.228"></a>
-<span class="sourceLineNo">229</span><a name="line.229"></a>
-<span class="sourceLineNo">230</span>            this.callSetter(bean, prop, value);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>        }<a name="line.231"></a>
+<span class="sourceLineNo">224</span>            Object value = null;<a name="line.224"></a>
+<span class="sourceLineNo">225</span>            if(propType != null) {<a name="line.225"></a>
+<span class="sourceLineNo">226</span>                value = this.processColumn(rs, i, propType);<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>                if (value == null &amp;&amp; propType.isPrimitive()) {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>                    value = primitiveDefaults.get(propType);<a name="line.229"></a>
+<span class="sourceLineNo">230</span>                }<a name="line.230"></a>
+<span class="sourceLineNo">231</span>            }<a name="line.231"></a>
 <span class="sourceLineNo">232</span><a name="line.232"></a>
-<span class="sourceLineNo">233</span>        return bean;<a name="line.233"></a>
-<span class="sourceLineNo">234</span>    }<a name="line.234"></a>
+<span class="sourceLineNo">233</span>            this.callSetter(bean, prop, value);<a name="line.233"></a>
+<span class="sourceLineNo">234</span>        }<a name="line.234"></a>
 <span class="sourceLineNo">235</span><a name="line.235"></a>
-<span class="sourceLineNo">236</span>    /**<a name="line.236"></a>
-<span class="sourceLineNo">237</span>     * Calls the setter method on the target object for the given property.<a name="line.237"></a>
-<span class="sourceLineNo">238</span>     * If no setter method exists for the property, this method does nothing.<a name="line.238"></a>
-<span class="sourceLineNo">239</span>     * @param target The object to set the property on.<a name="line.239"></a>
-<span class="sourceLineNo">240</span>     * @param prop The property to set.<a name="line.240"></a>
-<span class="sourceLineNo">241</span>     * @param value The value to pass into the setter.<a name="line.241"></a>
-<span class="sourceLineNo">242</span>     * @throws SQLException if an error occurs setting the property.<a name="line.242"></a>
-<span class="sourceLineNo">243</span>     */<a name="line.243"></a>
-<span class="sourceLineNo">244</span>    private void callSetter(Object target, PropertyDescriptor prop, Object value)<a name="line.244"></a>
-<span class="sourceLineNo">245</span>            throws SQLException {<a name="line.245"></a>
-<span class="sourceLineNo">246</span><a name="line.246"></a>
-<span class="sourceLineNo">247</span>        Method setter = prop.getWriteMethod();<a name="line.247"></a>
-<span class="sourceLineNo">248</span><a name="line.248"></a>
-<span class="sourceLineNo">249</span>        if (setter == null) {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>            return;<a name="line.250"></a>
-<span class="sourceLineNo">251</span>        }<a name="line.251"></a>
-<span class="sourceLineNo">252</span><a name="line.252"></a>
-<span class="sourceLineNo">253</span>        Class&lt;?&gt;[] params = setter.getParameterTypes();<a name="line.253"></a>
-<span class="sourceLineNo">254</span>        try {<a name="line.254"></a>
-<span class="sourceLineNo">255</span>            // convert types for some popular ones<a name="line.255"></a>
-<span class="sourceLineNo">256</span>            if (value instanceof java.util.Date) {<a name="line.256"></a>
-<span class="sourceLineNo">257</span>                final String targetType = params[0].getName();<a name="line.257"></a>
-<span class="sourceLineNo">258</span>                if ("java.sql.Date".equals(targetType)) {<a name="line.258"></a>
-<span class="sourceLineNo">259</span>                    value = new java.sql.Date(((java.util.Date) value).getTime());<a name="line.259"></a>
-<span class="sourceLineNo">260</span>                } else<a name="line.260"></a>
-<span class="sourceLineNo">261</span>                if ("java.sql.Time".equals(targetType)) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>                    value = new java.sql.Time(((java.util.Date) value).getTime());<a name="line.262"></a>
+<span class="sourceLineNo">236</span>        return bean;<a name="line.236"></a>
+<span class="sourceLineNo">237</span>    }<a name="line.237"></a>
+<span class="sourceLineNo">238</span><a name="line.238"></a>
+<span class="sourceLineNo">239</span>    /**<a name="line.239"></a>
+<span class="sourceLineNo">240</span>     * Calls the setter method on the target object for the given property.<a name="line.240"></a>
+<span class="sourceLineNo">241</span>     * If no setter method exists for the property, this method does nothing.<a name="line.241"></a>
+<span class="sourceLineNo">242</span>     * @param target The object to set the property on.<a name="line.242"></a>
+<span class="sourceLineNo">243</span>     * @param prop The property to set.<a name="line.243"></a>
+<span class="sourceLineNo">244</span>     * @param value The value to pass into the setter.<a name="line.244"></a>
+<span class="sourceLineNo">245</span>     * @throws SQLException if an error occurs setting the property.<a name="line.245"></a>
+<span class="sourceLineNo">246</span>     */<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    private void callSetter(Object target, PropertyDescriptor prop, Object value)<a name="line.247"></a>
+<span class="sourceLineNo">248</span>            throws SQLException {<a name="line.248"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
+<span class="sourceLineNo">250</span>        Method setter = prop.getWriteMethod();<a name="line.250"></a>
+<span class="sourceLineNo">251</span><a name="line.251"></a>
+<span class="sourceLineNo">252</span>        if (setter == null) {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>            return;<a name="line.253"></a>
+<span class="sourceLineNo">254</span>        }<a name="line.254"></a>
+<span class="sourceLineNo">255</span><a name="line.255"></a>
+<span class="sourceLineNo">256</span>        Class&lt;?&gt;[] params = setter.getParameterTypes();<a name="line.256"></a>
+<span class="sourceLineNo">257</span>        try {<a name="line.257"></a>
+<span class="sourceLineNo">258</span>            // convert types for some popular ones<a name="line.258"></a>
+<span class="sourceLineNo">259</span>            if (value instanceof java.util.Date) {<a name="line.259"></a>
+<span class="sourceLineNo">260</span>                final String targetType = params[0].getName();<a name="line.260"></a>
+<span class="sourceLineNo">261</span>                if ("java.sql.Date".equals(targetType)) {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>                    value = new java.sql.Date(((java.util.Date) value).getTime());<a name="line.262"></a>
 <span class="sourceLineNo">263</span>                } else<a name="line.263"></a>
-<span class="sourceLineNo">264</span>                if ("java.sql.Timestamp".equals(targetType)) {<a name="line.264"></a>
-<span class="sourceLineNo">265</span>                    value = new java.sql.Timestamp(((java.util.Date) value).getTime());<a name="line.265"></a>
-<span class="sourceLineNo">266</span>                }<a name="line.266"></a>
-<span class="sourceLineNo">267</span>            }<a name="line.267"></a>
-<span class="sourceLineNo">268</span><a name="line.268"></a>
-<span class="sourceLineNo">269</span>            // Don't call setter if the value object isn't the right type<a name="line.269"></a>
-<span class="sourceLineNo">270</span>            if (this.isCompatibleType(value, params[0])) {<a name="line.270"></a>
-<span class="sourceLineNo">271</span>                setter.invoke(target, new Object[]{value});<a name="line.271"></a>
-<span class="sourceLineNo">272</span>            } else {<a name="line.272"></a>
-<span class="sourceLineNo">273</span>              throw new SQLException(<a name="line.273"></a>
-<span class="sourceLineNo">274</span>                  "Cannot set " + prop.getName() + ": incompatible types, cannot convert "<a name="line.274"></a>
-<span class="sourceLineNo">275</span>                  + value.getClass().getName() + " to " + params[0].getName());<a name="line.275"></a>
-<span class="sourceLineNo">276</span>                  // value cannot be null here because isCompatibleType allows null<a name="line.276"></a>
-<span class="sourceLineNo">277</span>            }<a name="line.277"></a>
-<span class="sourceLineNo">278</span><a name="line.278"></a>
-<span class="sourceLineNo">279</span>        } catch (IllegalArgumentException e) {<a name="line.279"></a>
-<span class="sourceLineNo">280</span>            throw new SQLException(<a name="line.280"></a>
-<span class="sourceLineNo">281</span>                "Cannot set " + prop.getName() + ": " + e.getMessage());<a name="line.281"></a>
-<span class="sourceLineNo">282</span><a name="line.282"></a>
-<span class="sourceLineNo">283</span>        } catch (IllegalAccessException e) {<a name="line.283"></a>
-<span class="sourceLineNo">284</span>            throw new SQLException(<a name="line.284"></a>
-<span class="sourceLineNo">285</span>                "Cannot set " + prop.getName() + ": " + e.getMessage());<a name="line.285"></a>
-<span class="sourceLineNo">286</span><a name="line.286"></a>
-<span class="sourceLineNo">287</span>        } catch (InvocationTargetException e) {<a name="line.287"></a>
-<span class="sourceLineNo">288</span>            throw new SQLException(<a name="line.288"></a>
-<span class="sourceLineNo">289</span>                "Cannot set " + prop.getName() + ": " + e.getMessage());<a name="line.289"></a>
-<span class="sourceLineNo">290</span>        }<a name="line.290"></a>
-<span class="sourceLineNo">291</span>    }<a name="line.291"></a>
-<span class="sourceLineNo">292</span><a name="line.292"></a>
-<span class="sourceLineNo">293</span>    /**<a name="line.293"></a>
-<span class="sourceLineNo">294</span>     * ResultSet.getObject() returns an Integer object for an INT column.  The<a name="line.294"></a>
-<span class="sourceLineNo">295</span>     * setter method for the property might take an Integer or a primitive int.<a name="line.295"></a>
-<span class="sourceLineNo">296</span>     * This method returns true if the value can be successfully passed into<a name="line.296"></a>
-<span class="sourceLineNo">297</span>     * the setter method.  Remember, Method.invoke() handles the unwrapping<a name="line.297"></a>
-<span class="sourceLineNo">298</span>     * of Integer into an int.<a name="line.298"></a>
-<span class="sourceLineNo">299</span>     *<a name="line.299"></a>
-<span class="sourceLineNo">300</span>     * @param value The value to be passed into the setter method.<a name="line.300"></a>
-<span class="sourceLineNo">301</span>     * @param type The setter's parameter type (non-null)<a name="line.301"></a>
-<span class="sourceLineNo">302</span>     * @return boolean True if the value is compatible (null =&gt; true)<a name="line.302"></a>
-<span class="sourceLineNo">303</span>     */<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    private boolean isCompatibleType(Object value, Class&lt;?&gt; type) {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>        // Do object check first, then primitives<a name="line.305"></a>
-<span class="sourceLineNo">306</span>        if (value == null || type.isInstance(value)) {<a name="line.306"></a>
-<span class="sourceLineNo">307</span>            return true;<a name="line.307"></a>
-<span class="sourceLineNo">308</span><a name="line.308"></a>
-<span class="sourceLineNo">309</span>        } else if (type.equals(Integer.TYPE) &amp;&amp; value instanceof Integer) {<a name="line.309"></a>
-<span class="sourceLineNo">310</span>            return true;<a name="line.310"></a>
-<span class="sourceLineNo">311</span><a name="line.311"></a>
-<span class="sourceLineNo">312</span>        } else if (type.equals(Long.TYPE) &amp;&amp; value instanceof Long) {<a name="line.312"></a>
-<span class="sourceLineNo">313</span>            return true;<a name="line.313"></a>
-<span class="sourceLineNo">314</span><a name="line.314"></a>
-<span class="sourceLineNo">315</span>        } else if (type.equals(Double.TYPE) &amp;&amp; value instanceof Double) {<a name="line.315"></a>
+<span class="sourceLineNo">264</span>                if ("java.sql.Time".equals(targetType)) {<a name="line.264"></a>
+<span class="sourceLineNo">265</span>                    value = new java.sql.Time(((java.util.Date) value).getTime());<a name="line.265"></a>
+<span class="sourceLineNo">266</span>                } else<a name="line.266"></a>
+<span class="sourceLineNo">267</span>                if ("java.sql.Timestamp".equals(targetType)) {<a name="line.267"></a>
+<span class="sourceLineNo">268</span>                    Timestamp tsValue = (Timestamp) value;<a name="line.268"></a>
+<span class="sourceLineNo">269</span>                    int nanos = tsValue.getNanos();<a name="line.269"></a>
+<span class="sourceLineNo">270</span>                    value = new java.sql.Timestamp(tsValue.getTime());<a name="line.270"></a>
+<span class="sourceLineNo">271</span>                    ((Timestamp) value).setNanos(nanos);<a name="line.271"></a>
+<span class="sourceLineNo">272</span>                }<a name="line.272"></a>
+<span class="sourceLineNo">273</span>            } else<a name="line.273"></a>
+<span class="sourceLineNo">274</span>            if (value instanceof String &amp;&amp; params[0].isEnum()) {<a name="line.274"></a>
+<span class="sourceLineNo">275</span>                value = Enum.valueOf(params[0].asSubclass(Enum.class), (String) value);<a name="line.275"></a>
+<span class="sourceLineNo">276</span>            }<a name="line.276"></a>
+<span class="sourceLineNo">277</span><a name="line.277"></a>
+<span class="sourceLineNo">278</span>            // Don't call setter if the value object isn't the right type<a name="line.278"></a>
+<span class="sourceLineNo">279</span>            if (this.isCompatibleType(value, params[0])) {<a name="line.279"></a>
+<span class="sourceLineNo">280</span>                setter.invoke(target, new Object[]{value});<a name="line.280"></a>
+<span class="sourceLineNo">281</span>            } else {<a name="line.281"></a>
+<span class="sourceLineNo">282</span>              throw new SQLException(<a name="line.282"></a>
+<span class="sourceLineNo">283</span>                  "Cannot set " + prop.getName() + ": incompatible types, cannot convert "<a name="line.283"></a>
+<span class="sourceLineNo">284</span>                  + value.getClass().getName() + " to " + params[0].getName());<a name="line.284"></a>
+<span class="sourceLineNo">285</span>                  // value cannot be null here because isCompatibleType allows null<a name="line.285"></a>
+<span class="sourceLineNo">286</span>            }<a name="line.286"></a>
+<span class="sourceLineNo">287</span><a name="line.287"></a>
+<span class="sourceLineNo">288</span>        } catch (IllegalArgumentException e) {<a name="line.288"></a>
+<span class="sourceLineNo">289</span>            throw new SQLException(<a name="line.289"></a>
+<span class="sourceLineNo">290</span>                "Cannot set " + prop.getName() + ": " + e.getMessage());<a name="line.290"></a>
+<span class="sourceLineNo">291</span><a name="line.291"></a>
+<span class="sourceLineNo">292</span>        } catch (IllegalAccessException e) {<a name="line.292"></a>
+<span class="sourceLineNo">293</span>            throw new SQLException(<a name="line.293"></a>
+<span class="sourceLineNo">294</span>                "Cannot set " + prop.getName() + ": " + e.getMessage());<a name="line.294"></a>
+<span class="sourceLineNo">295</span><a name="line.295"></a>
+<span class="sourceLineNo">296</span>        } catch (InvocationTargetException e) {<a name="line.296"></a>
+<span class="sourceLineNo">297</span>            throw new SQLException(<a name="line.297"></a>
+<span class="sourceLineNo">298</span>                "Cannot set " + prop.getName() + ": " + e.getMessage());<a name="line.298"></a>
+<span class="sourceLineNo">299</span>        }<a name="line.299"></a>
+<span class="sourceLineNo">300</span>    }<a name="line.300"></a>
+<span class="sourceLineNo">301</span><a name="line.301"></a>
+<span class="sourceLineNo">302</span>    /**<a name="line.302"></a>
+<span class="sourceLineNo">303</span>     * ResultSet.getObject() returns an Integer object for an INT column.  The<a name="line.303"></a>
+<span class="sourceLineNo">304</span>     * setter method for the property might take an Integer or a primitive int.<a name="line.304"></a>
+<span class="sourceLineNo">305</span>     * This method returns true if the value can be successfully passed into<a name="line.305"></a>
+<span class="sourceLineNo">306</span>     * the setter method.  Remember, Method.invoke() handles the unwrapping<a name="line.306"></a>
+<span class="sourceLineNo">307</span>     * of Integer into an int.<a name="line.307"></a>
+<span class="sourceLineNo">308</span>     *<a name="line.308"></a>
+<span class="sourceLineNo">309</span>     * @param value The value to be passed into the setter method.<a name="line.309"></a>
+<span class="sourceLineNo">310</span>     * @param type The setter's parameter type (non-null)<a name="line.310"></a>
+<span class="sourceLineNo">311</span>     * @return boolean True if the value is compatible (null =&gt; true)<a name="line.311"></a>
+<span class="sourceLineNo">312</span>     */<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    private boolean isCompatibleType(Object value, Class&lt;?&gt; type) {<a name="line.313"></a>
+<span class="sourceLineNo">314</span>        // Do object check first, then primitives<a name="line.314"></a>
+<span class="sourceLineNo">315</span>        if (value == null || type.isInstance(value)) {<a name="line.315"></a>
 <span class="sourceLineNo">316</span>            return true;<a name="line.316"></a>
 <span class="sourceLineNo">317</span><a name="line.317"></a>
-<span class="sourceLineNo">318</span>        } else if (type.equals(Float.TYPE) &amp;&amp; value instanceof Float) {<a name="line.318"></a>
+<span class="sourceLineNo">318</span>        } else if (type.equals(Integer.TYPE) &amp;&amp; value instanceof Integer) {<a name="line.318"></a>
 <span class="sourceLineNo">319</span>            return true;<a name="line.319"></a>
 <span class="sourceLineNo">320</span><a name="line.320"></a>
-<span class="sourceLineNo">321</span>        } else if (type.equals(Short.TYPE) &amp;&amp; value instanceof Short) {<a name="line.321"></a>
+<span class="sourceLineNo">321</span>        } else if (type.equals(Long.TYPE) &amp;&amp; value instanceof Long) {<a name="line.321"></a>
 <span class="sourceLineNo">322</span>            return true;<a name="line.322"></a>
 <span class="sourceLineNo">323</span><a name="line.323"></a>
-<span class="sourceLineNo">324</span>        } else if (type.equals(Byte.TYPE) &amp;&amp; value instanceof Byte) {<a name="line.324"></a>
+<span class="sourceLineNo">324</span>        } else if (type.equals(Double.TYPE) &amp;&amp; value instanceof Double) {<a name="line.324"></a>
 <span class="sourceLineNo">325</span>            return true;<a name="line.325"></a>
 <span class="sourceLineNo">326</span><a name="line.326"></a>
-<span class="sourceLineNo">327</span>        } else if (type.equals(Character.TYPE) &amp;&amp; value instanceof Character) {<a name="line.327"></a>
+<span class="sourceLineNo">327</span>        } else if (type.equals(Float.TYPE) &amp;&amp; value instanceof Float) {<a name="line.327"></a>
 <span class="sourceLineNo">328</span>            return true;<a name="line.328"></a>
 <span class="sourceLineNo">329</span><a name="line.329"></a>
-<span class="sourceLineNo">330</span>        } else if (type.equals(Boolean.TYPE) &amp;&amp; value instanceof Boolean) {<a name="line.330"></a>
+<span class="sourceLineNo">330</span>        } else if (type.equals(Short.TYPE) &amp;&amp; value instanceof Short) {<a name="line.330"></a>
 <span class="sourceLineNo">331</span>            return true;<a name="line.331"></a>
 <span class="sourceLineNo">332</span><a name="line.332"></a>
-<span class="sourceLineNo">333</span>        }<a name="line.333"></a>
-<span class="sourceLineNo">334</span>        return false;<a name="line.334"></a>
+<span class="sourceLineNo">333</span>        } else if (type.equals(Byte.TYPE) &amp;&amp; value instanceof Byte) {<a name="line.333"></a>
+<span class="sourceLineNo">334</span>            return true;<a name="line.334"></a>
 <span class="sourceLineNo">335</span><a name="line.335"></a>
-<span class="sourceLineNo">336</span>    }<a name="line.336"></a>
-<span class="sourceLineNo">337</span><a name="line.337"></a>
-<span class="sourceLineNo">338</span>    /**<a name="line.338"></a>
-<span class="sourceLineNo">339</span>     * Factory method that returns a new instance of the given Class.  This<a name="line.339"></a>
-<span class="sourceLineNo">340</span>     * is called at the start of the bean creation process and may be<a name="line.340"></a>
-<span class="sourceLineNo">341</span>     * overridden to provide custom behavior like returning a cached bean<a name="line.341"></a>
-<span class="sourceLineNo">342</span>     * instance.<a name="line.342"></a>
-<span class="sourceLineNo">343</span>     * @param &lt;T&gt; The type of object to create<a name="line.343"></a>
-<span class="sourceLineNo">344</span>     * @param c The Class to create an object from.<a name="line.344"></a>
-<span class="sourceLineNo">345</span>     * @return A newly created object of the Class.<a name="line.345"></a>
-<span class="sourceLineNo">346</span>     * @throws SQLException if creation failed.<a name="line.346"></a>
-<span class="sourceLineNo">347</span>     */<a name="line.347"></a>
-<span class="sourceLineNo">348</span>    protected &lt;T&gt; T newInstance(Class&lt;T&gt; c) throws SQLException {<a name="line.348"></a>
-<span class="sourceLineNo">349</span>        try {<a name="line.349"></a>
-<span class="sourceLineNo">350</span>            return c.newInstance();<a name="line.350"></a>
-<span class="sourceLineNo">351</span><a name="line.351"></a>
-<span class="sourceLineNo">352</span>        } catch (InstantiationException e) {<a name="line.352"></a>
-<span class="sourceLineNo">353</span>            throw new SQLException(<a name="line.353"></a>
-<span class="sourceLineNo">354</span>                "Cannot create " + c.getName() + ": " + e.getMessage());<a name="line.354"></a>
-<span class="sourceLineNo">355</span><a name="line.355"></a>
-<span class="sourceLineNo">356</span>        } catch (IllegalAccessException e) {<a name="line.356"></a>
-<span class="sourceLineNo">357</span>            throw new SQLException(<a name="line.357"></a>
-<span class="sourceLineNo">358</span>                "Cannot create " + c.getName() + ": " + e.getMessage());<a name="line.358"></a>
-<span class="sourceLineNo">359</span>        }<a name="line.359"></a>
-<span class="sourceLineNo">360</span>    }<a name="line.360"></a>
-<span class="sourceLineNo">361</span><a name="line.361"></a>
-<span class="sourceLineNo">362</span>    /**<a name="line.362"></a>
-<span class="sourceLineNo">363</span>     * Returns a PropertyDescriptor[] for the given Class.<a name="line.363"></a>
-<span class="sourceLineNo">364</span>     *<a name="line.364"></a>
-<span class="sourceLineNo">365</span>     * @param c The Class to retrieve PropertyDescriptors for.<a name="line.365"></a>
-<span class="sourceLineNo">366</span>     * @return A PropertyDescriptor[] describing the Class.<a name="line.366"></a>
-<span class="sourceLineNo">367</span>     * @throws SQLException if introspection failed.<a name="line.367"></a>
-<span class="sourceLineNo">368</span>     */<a name="line.368"></a>
-<span class="sourceLineNo">369</span>    private PropertyDescriptor[] propertyDescriptors(Class&lt;?&gt; c)<a name="line.369"></a>
-<span class="sourceLineNo">370</span>        throws SQLException {<a name="line.370"></a>
-<span class="sourceLineNo">371</span>        // Introspector caches BeanInfo classes for better performance<a name="line.371"></a>
-<span class="sourceLineNo">372</span>        BeanInfo beanInfo = null;<a name="line.372"></a>
-<span class="sourceLineNo">373</span>        try {<a name="line.373"></a>
-<span class="sourceLineNo">374</span>            beanInfo = Introspector.getBeanInfo(c);<a name="line.374"></a>
-<span class="sourceLineNo">375</span><a name="line.375"></a>
-<span class="sourceLineNo">376</span>        } catch (IntrospectionException e) {<a name="line.376"></a>
-<span class="sourceLineNo">377</span>            throw new SQLException(<a name="line.377"></a>
-<span class="sourceLineNo">378</span>                "Bean introspection failed: " + e.getMessage());<a name="line.378"></a>
-<span class="sourceLineNo">379</span>        }<a name="line.379"></a>
-<span class="sourceLineNo">380</span><a name="line.380"></a>
-<span class="sourceLineNo">381</span>        return beanInfo.getPropertyDescriptors();<a name="line.381"></a>
-<span class="sourceLineNo">382</span>    }<a name="line.382"></a>
-<span class="sourceLineNo">383</span><a name="line.383"></a>
-<span class="sourceLineNo">384</span>    /**<a name="line.384"></a>
-<span class="sourceLineNo">385</span>     * The positions in the returned array represent column numbers.  The<a name="line.385"></a>
-<span class="sourceLineNo">386</span>     * values stored at each position represent the index in the<a name="line.386"></a>
-<span class="sourceLineNo">387</span>     * &lt;code&gt;PropertyDescriptor[]&lt;/code&gt; for the bean property that matches<a name="line.387"></a>
-<span class="sourceLineNo">388</span>     * the column name.  If no bean property was found for a column, the<a name="line.388"></a>
-<span class="sourceLineNo">389</span>     * position is set to &lt;code&gt;PROPERTY_NOT_FOUND&lt;/code&gt;.<a name="line.389"></a>
-<span class="sourceLineNo">390</span>     *<a name="line.390"></a>
-<span class="sourceLineNo">391</span>     * @param rsmd The &lt;code&gt;ResultSetMetaData&lt;/code&gt; containing column<a name="line.391"></a>
-<span class="sourceLineNo">392</span>     * information.<a name="line.392"></a>
-<span class="sourceLineNo">393</span>     *<a name="line.393"></a>
-<span class="sourceLineNo">394</span>     * @param props The bean property descriptors.<a name="line.394"></a>
-<span class="sourceLineNo">395</span>     *<a name="line.395"></a>
-<span class="sourceLineNo">396</span>     * @throws SQLException if a database access error occurs<a name="line.396"></a>
-<span class="sourceLineNo">397</span>     *<a name="line.397"></a>
-<span class="sourceLineNo">398</span>     * @return An int[] with column index to property index mappings.  The 0th<a name="line.398"></a>
-<span class="sourceLineNo">399</span>     * element is meaningless because JDBC column indexing starts at 1.<a name="line.399"></a>
-<span class="sourceLineNo">400</span>     */<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    protected int[] mapColumnsToProperties(ResultSetMetaData rsmd,<a name="line.401"></a>
-<span class="sourceLineNo">402</span>            PropertyDescriptor[] props) throws SQLException {<a name="line.402"></a>
-<span class="sourceLineNo">403</span><a name="line.403"></a>
-<span class="sourceLineNo">404</span>        int cols = rsmd.getColumnCount();<a name="line.404"></a>
-<span class="sourceLineNo">405</span>        int[] columnToProperty = new int[cols + 1];<a name="line.405"></a>
-<span class="sourceLineNo">406</span>        Arrays.fill(columnToProperty, PROPERTY_NOT_FOUND);<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>        for (int col = 1; col &lt;= cols; col++) {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>            String columnName = rsmd.getColumnLabel(col);<a name="line.409"></a>
-<span class="sourceLineNo">410</span>            if (null == columnName || 0 == columnName.length()) {<a name="line.410"></a>
-<span class="sourceLineNo">411</span>              columnName = rsmd.getColumnName(col);<a name="line.411"></a>
-<span class="sourceLineNo">412</span>            }<a name="line.412"></a>
-<span class="sourceLineNo">413</span>            String propertyName = columnToPropertyOverrides.get(columnName);<a name="line.413"></a>
-<span class="sourceLineNo">414</span>            if (propertyName == null) {<a name="line.414"></a>
-<span class="sourceLineNo">415</span>                propertyName = columnName;<a name="line.415"></a>
-<span class="sourceLineNo">416</span>            }<a name="line.416"></a>
-<span class="sourceLineNo">417</span>            for (int i = 0; i &lt; props.length; i++) {<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>                if (propertyName.equalsIgnoreCase(props[i].getName())) {<a name="line.419"></a>
-<span class="sourceLineNo">420</span>                    columnToProperty[col] = i;<a name="line.420"></a>
-<span class="sourceLineNo">421</span>                    break;<a name="line.421"></a>
-<span class="sourceLineNo">422</span>                }<a name="line.422"></a>
-<span class="sourceLineNo">423</span>            }<a name="line.423"></a>
-<span class="sourceLineNo">424</span>        }<a name="line.424"></a>
-<span class="sourceLineNo">425</span><a name="line.425"></a>
-<span class="sourceLineNo">426</span>        return columnToProperty;<a name="line.426"></a>
-<span class="sourceLineNo">427</span>    }<a name="line.427"></a>
-<span class="sourceLineNo">428</span><a name="line.428"></a>
-<span class="sourceLineNo">429</span>    /**<a name="line.429"></a>
-<span class="sourceLineNo">430</span>     * Convert a &lt;code&gt;ResultSet&lt;/code&gt; column into an object.  Simple<a name="line.430"></a>
-<span class="sourceLineNo">431</span>     * implementations could just call &lt;code&gt;rs.getObject(index)&lt;/code&gt; while<a name="line.431"></a>
-<span class="sourceLineNo">432</span>     * more complex implementations could perform type manipulation to match<a name="line.432"></a>
-<span class="sourceLineNo">433</span>     * the column's type to the bean property type.<a name="line.433"></a>
-<span class="sourceLineNo">434</span>     *<a name="line.434"></a>
-<span class="sourceLineNo">435</span>     * &lt;p&gt;<a name="line.435"></a>
-<span class="sourceLineNo">436</span>     * This implementation calls the appropriate &lt;code&gt;ResultSet&lt;/code&gt; getter<a name="line.436"></a>
-<span class="sourceLineNo">437</span>     * method for the given property type to perform the type conversion.  If<a name="line.437"></a>
-<span class="sourceLineNo">438</span>     * the property type doesn't match one of the supported<a name="line.438"></a>
-<span class="sourceLineNo">439</span>     * &lt;code&gt;ResultSet&lt;/code&gt; types, &lt;code&gt;getObject&lt;/code&gt; is called.<a name="line.439"></a>
-<span class="sourceLineNo">440</span>     * &lt;/p&gt;<a name="line.440"></a>
-<span class="sourceLineNo">441</span>     *<a name="line.441"></a>
-<span class="sourceLineNo">442</span>     * @param rs The &lt;code&gt;ResultSet&lt;/code&gt; currently being processed.  It is<a name="line.442"></a>
-<span class="sourceLineNo">443</span>     * positioned on a valid row before being passed into this method.<a name="line.443"></a>
-<span class="sourceLineNo">444</span>     *<a name="line.444"></a>
-<span class="sourceLineNo">445</span>     * @param index The current column index being processed.<a name="line.445"></a>
-<span class="sourceLineNo">446</span>     *<a name="line.446"></a>
-<span class="sourceLineNo">447</span>     * @param propType The bean property type that this column needs to be<a name="line.447"></a>
-<span class="sourceLineNo">448</span>     * converted into.<a name="line.448"></a>
-<span class="sourceLineNo">449</span>     *<a name="line.449"></a>
-<span class="sourceLineNo">450</span>     * @throws SQLException if a database access error occurs<a name="line.450"></a>
-<span class="sourceLineNo">451</span>     *<a name="line.451"></a>
-<span class="sourceLineNo">452</span>     * @return The object from the &lt;code&gt;ResultSet&lt;/code&gt; at the given column<a name="line.452"></a>
-<span class="sourceLineNo">453</span>     * index after optional type processing or &lt;code&gt;null&lt;/code&gt; if the column<a name="line.453"></a>
-<span class="sourceLineNo">454</span>     * value was SQL NULL.<a name="line.454"></a>
-<span class="sourceLineNo">455</span>     */<a name="line.455"></a>
-<span class="sourceLineNo">456</span>    protected Object processColumn(ResultSet rs, int index, Class&lt;?&gt; propType)<a name="line.456"></a>
-<span class="sourceLineNo">457</span>        throws SQLException {<a name="line.457"></a>
-<span class="sourceLineNo">458</span><a name="line.458"></a>
-<span class="sourceLineNo">459</span>        if ( !propType.isPrimitive() &amp;&amp; rs.getObject(index) == null ) {<a name="line.459"></a>
-<span class="sourceLineNo">460</span>            return null;<a name="line.460"></a>
-<span class="sourceLineNo">461</span>        }<a name="line.461"></a>
-<span class="sourceLineNo">462</span><a name="line.462"></a>
-<span class="sourceLineNo">463</span>        if (propType.equals(String.class)) {<a name="line.463"></a>
-<span class="sourceLineNo">464</span>            return rs.getString(index);<a name="line.464"></a>
-<span class="sourceLineNo">465</span><a name="line.465"></a>
-<span class="sourceLineNo">466</span>        } else if (<a name="line.466"></a>
-<span class="sourceLineNo">467</span>            propType.equals(Integer.TYPE) || propType.equals(Integer.class)) {<a name="line.467"></a>
-<span class="sourceLineNo">468</span>            return Integer.valueOf(rs.getInt(index));<a name="line.468"></a>
-<span class="sourceLineNo">469</span><a name="line.469"></a>
-<span class="sourceLineNo">470</span>        } else if (<a name="line.470"></a>
-<span class="sourceLineNo">471</span>            propType.equals(Boolean.TYPE) || propType.equals(Boolean.class)) {<a name="line.471"></a>
-<span class="sourceLineNo">472</span>            return Boolean.valueOf(rs.getBoolean(index));<a name="line.472"></a>
-<span class="sourceLineNo">473</span><a name="line.473"></a>
-<span class="sourceLineNo">474</span>        } else if (propType.equals(Long.TYPE) || propType.equals(Long.class)) {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>            return Long.valueOf(rs.getLong(index));<a name="line.475"></a>
-<span class="sourceLineNo">476</span><a name="line.476"></a>
-<span class="sourceLineNo">477</span>        } else if (<a name="line.477"></a>
-<span class="sourceLineNo">478</span>            propType.equals(Double.TYPE) || propType.equals(Double.class)) {<a name="line.478"></a>
-<span class="sourceLineNo">479</span>            return Double.valueOf(rs.getDouble(index));<a name="line.479"></a>
-<span class="sourceLineNo">480</span><a name="line.480"></a>
-<span class="sourceLineNo">481</span>        } else if (<a name="line.481"></a>
-<span class="sourceLineNo">482</span>            propType.equals(Float.TYPE) || propType.equals(Float.class)) {<a name="line.482"></a>
-<span class="sourceLineNo">483</span>            return Float.valueOf(rs.getFloat(index));<a name="line.483"></a>
-<span class="sourceLineNo">484</span><a name="line.484"></a>
-<span class="sourceLineNo">485</span>        } else if (<a name="line.485"></a>
-<span class="sourceLineNo">486</span>            propType.equals(Short.TYPE) || propType.equals(Short.class)) {<a name="line.486"></a>
-<span class="sourceLineNo">487</span>            return Short.valueOf(rs.getShort(index));<a name="line.487"></a>
-<span class="sourceLineNo">488</span><a name="line.488"></a>
-<span class="sourceLineNo">489</span>        } else if (propType.equals(Byte.TYPE) || propType.equals(Byte.class)) {<a name="line.489"></a>
-<span class="sourceLineNo">490</span>            return Byte.valueOf(rs.getByte(index));<a name="line.490"></a>
-<span class="sourceLineNo">491</span><a name="line.491"></a>
-<span class="sourceLineNo">492</span>        } else if (propType.equals(Timestamp.class)) {<a name="line.492"></a>
-<span class="sourceLineNo">493</span>            return rs.getTimestamp(index);<a name="line.493"></a>
-<span class="sourceLineNo">494</span><a name="line.494"></a>
-<span class="sourceLineNo">495</span>        } else if (propType.equals(SQLXML.class)) {<a name="line.495"></a>
-<span class="sourceLineNo">496</span>            return rs.getSQLXML(index);<a name="line.496"></a>
+<span class="sourceLineNo">336</span>        } else if (type.equals(Character.TYPE) &amp;&amp; value instanceof Character) {<a name="line.336"></a>
+<span class="sourceLineNo">337</span>            return true;<a name="line.337"></a>
+<span class="sourceLineNo">338</span><a name="line.338"></a>
+<span class="sourceLineNo">339</span>        } else if (type.equals(Boolean.TYPE) &amp;&amp; value instanceof Boolean) {<a name="line.339"></a>
+<span class="sourceLineNo">340</span>            return true;<a name="line.340"></a>
+<span class="sourceLineNo">341</span><a name="line.341"></a>
+<span class="sourceLineNo">342</span>        }<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        return false;<a name="line.343"></a>
+<span class="sourceLineNo">344</span><a name="line.344"></a>
+<span class="sourceLineNo">345</span>    }<a name="line.345"></a>
+<span class="sourceLineNo">346</span><a name="line.346"></a>
+<span class="sourceLineNo">347</span>    /**<a name="line.347"></a>
+<span class="sourceLineNo">348</span>     * Factory method that returns a new instance of the given Class.  This<a name="line.348"></a>
+<span class="sourceLineNo">349</span>     * is called at the start of the bean creation process and may be<a name="line.349"></a>
+<span class="sourceLineNo">350</span>     * overridden to provide custom behavior like returning a cached bean<a name="line.350"></a>
+<span class="sourceLineNo">351</span>     * instance.<a name="line.351"></a>
+<span class="sourceLineNo">352</span>     * @param &lt;T&gt; The type of object to create<a name="line.352"></a>
+<span class="sourceLineNo">353</span>     * @param c The Class to create an object from.<a name="line.353"></a>
+<span class="sourceLineNo">354</span>     * @return A newly created object of the Class.<a name="line.354"></a>
+<span class="sourceLineNo">355</span>     * @throws SQLException if creation failed.<a name="line.355"></a>
+<span class="sourceLineNo">356</span>     */<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    protected &lt;T&gt; T newInstance(Class&lt;T&gt; c) throws SQLException {<a name="line.357"></a>
+<span class="sourceLineNo">358</span>        try {<a name="line.358"></a>
+<span class="sourceLineNo">359</span>            return c.newInstance();<a name="line.359"></a>
+<span class="sourceLineNo">360</span><a name="line.360"></a>
+<span class="sourceLineNo">361</span>        } catch (InstantiationException e) {<a name="line.361"></a>
+<span class="sourceLineNo">362</span>            throw new SQLException(<a name="line.362"></a>
+<span class="sourceLineNo">363</span>                "Cannot create " + c.getName() + ": " + e.getMessage());<a name="line.363"></a>
+<span class="sourceLineNo">364</span><a name="line.364"></a>
+<span class="sourceLineNo">365</span>        } catch (IllegalAccessException e) {<a name="line.365"></a>
+<span class="sourceLineNo">366</span>            throw new SQLException(<a name="line.366"></a>
+<span class="sourceLineNo">367</span>                "Cannot create " + c.getName() + ": " + e.getMessage());<a name="line.367"></a>
+<span class="sourceLineNo">368</span>        }<a name="line.368"></a>
+<span class="sourceLineNo">369</span>    }<a name="line.369"></a>
+<span class="sourceLineNo">370</span><a name="line.370"></a>
+<span class="sourceLineNo">371</span>    /**<a name="line.371"></a>
+<span class="sourceLineNo">372</span>     * Returns a PropertyDescriptor[] for the given Class.<a name="line.372"></a>
+<span class="sourceLineNo">373</span>     *<a name="line.373"></a>
+<span class="sourceLineNo">374</span>     * @param c The Class to retrieve PropertyDescriptors for.<a name="line.374"></a>
+<span class="sourceLineNo">375</span>     * @return A PropertyDescriptor[] describing the Class.<a name="line.375"></a>
+<span class="sourceLineNo">376</span>     * @throws SQLException if introspection failed.<a name="line.376"></a>
+<span class="sourceLineNo">377</span>     */<a name="line.377"></a>
+<span class="sourceLineNo">378</span>    private PropertyDescriptor[] propertyDescriptors(Class&lt;?&gt; c)<a name="line.378"></a>
+<span class="sourceLineNo">379</span>        throws SQLException {<a name="line.379"></a>
+<span class="sourceLineNo">380</span>        // Introspector caches BeanInfo classes for better performance<a name="line.380"></a>
+<span class="sourceLineNo">381</span>        BeanInfo beanInfo = null;<a name="line.381"></a>
+<span class="sourceLineNo">382</span>        try {<a name="line.382"></a>
+<span class="sourceLineNo">383</span>            beanInfo = Introspector.getBeanInfo(c);<a name="line.383"></a>
+<span class="sourceLineNo">384</span><a name="line.384"></a>
+<span class="sourceLineNo">385</span>        } catch (IntrospectionException e) {<a name="line.385"></a>
+<span class="sourceLineNo">386</span>            throw new SQLException(<a name="line.386"></a>
+<span class="sourceLineNo">387</span>                "Bean introspection failed: " + e.getMessage());<a name="line.387"></a>
+<span class="sourceLineNo">388</span>        }<a name="line.388"></a>
+<span class="sourceLineNo">389</span><a name="line.389"></a>
+<span class="sourceLineNo">390</span>        return beanInfo.getPropertyDescriptors();<a name="line.390"></a>
+<span class="sourceLineNo">391</span>    }<a name="line.391"></a>
+<span class="sourceLineNo">392</span><a name="line.392"></a>
+<span class="sourceLineNo">393</span>    /**<a name="line.393"></a>
+<span class="sourceLineNo">394</span>     * The positions in the returned array represent column numbers.  The<a name="line.394"></a>
+<span class="sourceLineNo">395</span>     * values stored at each position represent the index in the<a name="line.395"></a>
+<span class="sourceLineNo">396</span>     * &lt;code&gt;PropertyDescriptor[]&lt;/code&gt; for the bean property that matches<a name="line.396"></a>
+<span class="sourceLineNo">397</span>     * the column name.  If no bean property was found for a column, the<a name="line.397"></a>
+<span class="sourceLineNo">398</span>     * position is set to &lt;code&gt;PROPERTY_NOT_FOUND&lt;/code&gt;.<a name="line.398"></a>
+<span class="sourceLineNo">399</span>     *<a name="line.399"></a>
+<span class="sourceLineNo">400</span>     * @param rsmd The &lt;code&gt;ResultSetMetaData&lt;/code&gt; containing column<a name="line.400"></a>
+<span class="sourceLineNo">401</span>     * information.<a name="line.401"></a>
+<span class="sourceLineNo">402</span>     *<a name="line.402"></a>
+<span class="sourceLineNo">403</span>     * @param props The bean property descriptors.<a name="line.403"></a>
+<span class="sourceLineNo">404</span>     *<a name="line.404"></a>
+<span class="sourceLineNo">405</span>     * @throws SQLException if a database access error occurs<a name="line.405"></a>
+<span class="sourceLineNo">406</span>     *<a name="line.406"></a>
+<span class="sourceLineNo">407</span>     * @return An int[] with column index to property index mappings.  The 0th<a name="line.407"></a>
+<span class="sourceLineNo">408</span>     * element is meaningless because JDBC column indexing starts at 1.<a name="line.408"></a>
+<span class="sourceLineNo">409</span>     */<a name="line.409"></a>
+<span class="sourceLineNo">410</span>    protected int[] mapColumnsToProperties(ResultSetMetaData rsmd,<a name="line.410"></a>
+<span class="sourceLineNo">411</span>            PropertyDescriptor[] props) throws SQLException {<a name="line.411"></a>
+<span class="sourceLineNo">412</span><a name="line.412"></a>
+<span class="sourceLineNo">413</span>        int cols = rsmd.getColumnCount();<a name="line.413"></a>
+<span class="sourceLineNo">414</span>        int[] columnToProperty = new int[cols + 1];<a name="line.414"></a>
+<span class="sourceLineNo">415</span>        Arrays.fill(columnToProperty, PROPERTY_NOT_FOUND);<a name="line.415"></a>
+<span class="sourceLineNo">416</span><a name="line.416"></a>
+<span class="sourceLineNo">417</span>        for (int col = 1; col &lt;= cols; col++) {<a name="line.417"></a>
+<span class="sourceLineNo">418</span>            String columnName = rsmd.getColumnLabel(col);<a name="line.418"></a>
+<span class="sourceLineNo">419</span>            if (null == columnName || 0 == columnName.length()) {<a name="line.419"></a>
+<span class="sourceLineNo">420</span>              columnName = rsmd.getColumnName(col);<a name="line.420"></a>
+<span class="sourceLineNo">421</span>            }<a name="line.421"></a>
+<span class="sourceLineNo">422</span>            String propertyName = columnToPropertyOverrides.get(columnName);<a name="line.422"></a>
+<span class="sourceLineNo">423</span>            if (propertyName == null) {<a name="line.423"></a>
+<span class="sourceLineNo">424</span>                propertyName = columnName;<a name="line.424"></a>
+<span class="sourceLineNo">425</span>            }<a name="line.425"></a>
+<span class="sourceLineNo">426</span>            for (int i = 0; i &lt; props.length; i++) {<a name="line.426"></a>
+<span class="sourceLineNo">427</span><a name="line.427"></a>
+<span class="sourceLineNo">428</span>                if (propertyName.equalsIgnoreCase(props[i].getName())) {<a name="line.428"></a>
+<span class="sourceLineNo">429</span>                    columnToProperty[col] = i;<a name="line.429"></a>
+<span class="sourceLineNo">430</span>                    break;<a name="line.430"></a>
+<span class="sourceLineNo">431</span>                }<a name="line.431"></a>
+<span class="sourceLineNo">432</span>            }<a name="line.432"></a>
+<span class="sourceLineNo">433</span>        }<a name="line.433"></a>
+<span class="sourceLineNo">434</span><a name="line.434"></a>
+<span class="sourceLineNo">435</span>        return columnToProperty;<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    }<a name="line.436"></a>
+<span class="sourceLineNo">437</span><a name="line.437"></a>
+<span class="sourceLineNo">438</span>    /**<a name="line.438"></a>
+<span class="sourceLineNo">439</span>     * Convert a &lt;code&gt;ResultSet&lt;/code&gt; column into an object.  Simple<a name="line.439"></a>
+<span class="sourceLineNo">440</span>     * implementations could just call &lt;code&gt;rs.getObject(index)&lt;/code&gt; while<a name="line.440"></a>
+<span class="sourceLineNo">441</span>     * more complex implementations could perform type manipulation to match<a name="line.441"></a>
+<span class="sourceLineNo">442</span>     * the column's type to the bean property type.<a name="line.442"></a>
+<span class="sourceLineNo">443</span>     *<a name="line.443"></a>
+<span class="sourceLineNo">444</span>     * &lt;p&gt;<a name="line.444"></a>
+<span class="sourceLineNo">445</span>     * This implementation calls the appropriate &lt;code&gt;ResultSet&lt;/code&gt; getter<a name="line.445"></a>
+<span class="sourceLineNo">446</span>     * method for the given property type to perform the type conversion.  If<a name="line.446"></a>
+<span class="sourceLineNo">447</span>     * the property type doesn't match one of the supported<a name="line.447"></a>
+<span class="sourceLineNo">448</span>     * &lt;code&gt;ResultSet&lt;/code&gt; types, &lt;code&gt;getObject&lt;/code&gt; is called.<a name="line.448"></a>
+<span class="sourceLineNo">449</span>     * &lt;/p&gt;<a name="line.449"></a>
+<span class="sourceLineNo">450</span>     *<a name="line.450"></a>
+<span class="sourceLineNo">451</span>     * @param rs The &lt;code&gt;ResultSet&lt;/code&gt; currently being processed.  It is<a name="line.451"></a>
+<span class="sourceLineNo">452</span>     * positioned on a valid row before being passed into this method.<a name="line.452"></a>
+<span class="sourceLineNo">453</span>     *<a name="line.453"></a>
+<span class="sourceLineNo">454</span>     * @param index The current column index being processed.<a name="line.454"></a>
+<span class="sourceLineNo">455</span>     *<a name="line.455"></a>
+<span class="sourceLineNo">456</span>     * @param propType The bean property type that this column needs to be<a name="line.456"></a>
+<span class="sourceLineNo">457</span>     * converted into.<a name="line.457"></a>
+<span class="sourceLineNo">458</span>     *<a name="line.458"></a>
+<span class="sourceLineNo">459</span>     * @throws SQLException if a database access error occurs<a name="line.459"></a>
+<span class="sourceLineNo">460</span>     *<a name="line.460"></a>
+<span class="sourceLineNo">461</span>     * @return The object from the &lt;code&gt;ResultSet&lt;/code&gt; at the given column<a name="line.461"></a>
+<span class="sourceLineNo">462</span>     * index after optional type processing or &lt;code&gt;null&lt;/code&gt; if the column<a name="line.462"></a>
+<span class="sourceLineNo">463</span>     * value was SQL NULL.<a name="line.463"></a>
+<span class="sourceLineNo">464</span>     */<a name="line.464"></a>
+<span class="sourceLineNo">465</span>    protected Object processColumn(ResultSet rs, int index, Class&lt;?&gt; propType)<a name="line.465"></a>
+<span class="sourceLineNo">466</span>        throws SQLException {<a name="line.466"></a>
+<span class="sourceLineNo">467</span><a name="line.467"></a>
+<span class="sourceLineNo">468</span>        if ( !propType.isPrimitive() &amp;&amp; rs.getObject(index) == null ) {<a name="line.468"></a>
+<span class="sourceLineNo">469</span>            return null;<a name="line.469"></a>
+<span class="sourceLineNo">470</span>        }<a name="line.470"></a>
+<span class="sourceLineNo">471</span><a name="line.471"></a>
+<span class="sourceLineNo">472</span>        if (propType.equals(String.class)) {<a name="line.472"></a>
+<span class="sourceLineNo">473</span>            return rs.getString(index);<a name="line.473"></a>
+<span class="sourceLineNo">474</span><a name="line.474"></a>
+<span class="sourceLineNo">475</span>        } else if (<a name="line.475"></a>
+<span class="sourceLineNo">476</span>            propType.equals(Integer.TYPE) || propType.equals(Integer.class)) {<a name="line.476"></a>
+<span class="sourceLineNo">477</span>            return Integer.valueOf(rs.getInt(index));<a name="line.477"></a>
+<span class="sourceLineNo">478</span><a name="line.478"></a>
+<span class="sourceLineNo">479</span>        } else if (<a name="line.479"></a>
+<span class="sourceLineNo">480</span>            propType.equals(Boolean.TYPE) || propType.equals(Boolean.class)) {<a name="line.480"></a>
+<span class="sourceLineNo">481</span>            return Boolean.valueOf(rs.getBoolean(index));<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>        } else if (propType.equals(Long.TYPE) || propType.equals(Long.class)) {<a name="line.483"></a>
+<span class="sourceLineNo">484</span>            return Long.valueOf(rs.getLong(index));<a name="line.484"></a>
+<span class="sourceLineNo">485</span><a name="line.485"></a>
+<span class="sourceLineNo">486</span>        } else if (<a name="line.486"></a>
+<span class="sourceLineNo">487</span>            propType.equals(Double.TYPE) || propType.equals(Double.class)) {<a name="line.487"></a>
+<span class="sourceLineNo">488</span>            return Double.valueOf(rs.getDouble(index));<a name="line.488"></a>
+<span class="sourceLineNo">489</span><a name="line.489"></a>
+<span class="sourceLineNo">490</span>        } else if (<a name="line.490"></a>
+<span class="sourceLineNo">491</span>            propType.equals(Float.TYPE) || propType.equals(Float.class)) {<a name="line.491"></a>
+<span class="sourceLineNo">492</span>            return Float.valueOf(rs.getFloat(index));<a name="line.492"></a>
+<span class="sourceLineNo">493</span><a name="line.493"></a>
+<span class="sourceLineNo">494</span>        } else if (<a name="line.494"></a>
+<span class="sourceLineNo">495</span>            propType.equals(Short.TYPE) || propType.equals(Short.class)) {<a name="line.495"></a>
+<span class="sourceLineNo">496</span>            return Short.valueOf(rs.getShort(index));<a name="line.496"></a>
 <span class="sourceLineNo">497</span><a name="line.497"></a>
-<span class="sourceLineNo">498</span>        } else {<a name="line.498"></a>
-<span class="sourceLineNo">499</span>            return rs.getObject(index);<a name="line.499"></a>
-<span class="sourceLineNo">500</span>        }<a name="line.500"></a>
-<span class="sourceLineNo">501</span><a name="line.501"></a>
-<span class="sourceLineNo">502</span>    }<a name="line.502"></a>
+<span class="sourceLineNo">498</span>        } else if (propType.equals(Byte.TYPE) || propType.equals(Byte.class)) {<a name="line.498"></a>
+<span class="sourceLineNo">499</span>            return Byte.valueOf(rs.getByte(index));<a name="line.499"></a>
+<span class="sourceLineNo">500</span><a name="line.500"></a>
+<span class="sourceLineNo">501</span>        } else if (propType.equals(Timestamp.class)) {<a name="line.501"></a>
+<span class="sourceLineNo">502</span>            return rs.getTimestamp(index);<a name="line.502"></a>
 <span class="sourceLineNo">503</span><a name="line.503"></a>
-<span class="sourceLineNo">504</span>}<a name="line.504"></a>
+<span class="sourceLineNo">504</span>        } else if (propType.equals(SQLXML.class)) {<a name="line.504"></a>
+<span class="sourceLineNo">505</span>            return rs.getSQLXML(index);<a name="line.505"></a>
+<span class="sourceLineNo">506</span><a name="line.506"></a>
+<span class="sourceLineNo">507</span>        } else {<a name="line.507"></a>
+<span class="sourceLineNo">508</span>            return rs.getObject(index);<a name="line.508"></a>
+<span class="sourceLineNo">509</span>        }<a name="line.509"></a>
+<span class="sourceLineNo">510</span><a name="line.510"></a>
+<span class="sourceLineNo">511</span>    }<a name="line.511"></a>
+<span class="sourceLineNo">512</span><a name="line.512"></a>
+<span class="sourceLineNo">513</span>}<a name="line.513"></a>
 
 
 



Mime
View raw message