1 56 package org.objectstyle.cayenne.access.types; 57 58 import java.sql.CallableStatement ; 59 import java.sql.ResultSet ; 60 61 70 public class BooleanType extends AbstractType { 71 72 public String getClassName() { 73 return Boolean .class.getName(); 74 } 75 76 public Object materializeObject(ResultSet rs, int index, int type) throws Exception { 77 boolean b = rs.getBoolean(index); 78 return (rs.wasNull()) ? null : b ? Boolean.TRUE : Boolean.FALSE; 79 } 80 81 public Object materializeObject(CallableStatement st, int index, int type) 82 throws Exception { 83 boolean b = st.getBoolean(index); 84 return (st.wasNull()) ? null : b ? Boolean.TRUE : Boolean.FALSE; 85 } 86 } 87 | Popular Tags |