01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency.type;
10:
11: import com.completex.objective.util.TypeUtil;
12:
13: import java.sql.SQLException;
14:
15: /**
16: * @author Gennady Krizhevsky
17: */
18: public class BooleanTypeHandler extends DefaultTypeHandler {
19:
20: public Object transformRead(Object data) {
21: return TypeUtil.S2B(((String) data), TypeUtil.Y_N);
22: }
23:
24: public Object transformBind(Object data) throws SQLException {
25: return TypeUtil.B2S(((Boolean) data), TypeUtil.Y_N);
26: }
27:
28: }
|