1 16 17 package org.springframework.orm.hibernate.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(ResultSet rs, int index, LobHandler lobHandler) 74 throws SQLException { 75 76 return lobHandler.getClobAsString(rs, index); 77 } 78 79 protected void nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) 80 throws SQLException { 81 82 lobCreator.setClobAsString(ps, index, (String ) value); 83 } 84 85 } 86 | Popular Tags |