01: package com.completex.objective.components.persistency.type;
02:
03: import java.sql.SQLException;
04: import java.sql.Clob;
05:
06: /**
07: * @author Gennady Krizhevsky
08: */
09: public class DetachedClobTypeHandler extends ClobTypeHandler {
10:
11: public Object transformRead(Object data) throws SQLException {
12: if (data == null) {
13: return null;
14: }
15: if (data instanceof Clob) {
16: return new DetachedClobImpl(((Clob) data));
17: } else if (data instanceof String) {
18: return new DetachedClobImpl(((String) data));
19: } else {
20: throw new IllegalArgumentException("Unexpected data type: "
21: + data.getClass().getName());
22: }
23: }
24: }
|