/**
* Objective Database Abstraction Layer (ODAL)
* Copyright (c) 2004, The ODAL Development Group
* All rights reserved.
* For definition of the ODAL Development Group please refer to LICENCE.txt file
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package com.completex.objective.components.persistency.type;
import com.completex.objective.util.TypeUtil;
import java.sql.SQLException;
/**
* @author Gennady Krizhevsky
*/
public class BooleanTypeHandler extends DefaultTypeHandler {
public Object transformRead(Object data) {
return TypeUtil.S2B(((String) data), TypeUtil.Y_N);
}
public Object transformBind(Object data) throws SQLException {
return TypeUtil.B2S(((Boolean) data), TypeUtil.Y_N);
}
}
|