1 16 17 package org.springframework.orm.hibernate3.support; 18 19 import java.sql.PreparedStatement ; 20 import java.sql.ResultSet ; 21 import java.sql.SQLException ; 22 import java.sql.Types ; 23 24 import javax.transaction.TransactionManager ; 25 26 import org.springframework.jdbc.support.lob.LobCreator; 27 import org.springframework.jdbc.support.lob.LobHandler; 28 29 45 public class ClobStringType extends AbstractLobType { 46 47 53 public ClobStringType() { 54 super(); 55 } 56 57 61 protected ClobStringType(LobHandler lobHandler, TransactionManager jtaTransactionManager) { 62 super(lobHandler, jtaTransactionManager); 63 } 64 65 public int[] sqlTypes() { 66 return new int[] {Types.CLOB}; 67 } 68 69 public Class returnedClass() { 70 return String .class; 71 } 72 73 protected Object nullSafeGetInternal( 74 ResultSet rs, String [] names, Object owner, LobHandler lobHandler) 75 throws SQLException { 76 77 return lobHandler.getClobAsString(rs, names[0]); 78 } 79 80 protected void nullSafeSetInternal( 81 PreparedStatement ps, int index, Object value, LobCreator lobCreator) 82 throws SQLException { 83 84 lobCreator.setClobAsString(ps, index, (String ) value); 85 } 86 87 } 88 | Popular Tags |