Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type
In directory sc8-pr-cvs1:/tmp/cvs-serv24359
Added Files:
BlobType.java ClobType.java
Log Message:
BlobType, ClobType (by Benoit Menendez)
--- NEW FILE: BlobType.java ---
//$Id: BlobType.java,v 1.1 2002/12/12 11:33:36 oneovthafew Exp $
package cirrus.hibernate.type;
import java.sql.*;
import cirrus.hibernate.HibernateException;
public class BlobType extends ImmutableType {
public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
st.setBlob(index, (Blob) value);
}
public Object get(ResultSet rs, String name) throws HibernateException, SQLException {
return rs.getBlob(name);
}
public int sqlType() {
return Types.VARBINARY; //TODO: Types.BLOB
}
public Class returnedClass() {
return Blob.class;
}
public boolean hasNiceEquals() {
return false;
}
public boolean equals(Object x, Object y) throws HibernateException {
return x == y;
}
public String getName() {
return "blob";
}
public String toXML(Object val) throws HibernateException {
return val.toString();
}
}
--- NEW FILE: ClobType.java ---
//$Id: ClobType.java,v 1.1 2002/12/12 11:33:36 oneovthafew Exp $
package cirrus.hibernate.type;
import java.sql.*;
import cirrus.hibernate.HibernateException;
public class ClobType extends ImmutableType {
public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
st.setClob(index, (Clob) value);
}
public Object get(ResultSet rs, String name) throws HibernateException, SQLException {
return rs.getClob(name);
}
public int sqlType() {
return Types.VARCHAR; //TODO: Types.CLOB
}
public Class returnedClass() {
return Clob.class;
}
public boolean hasNiceEquals() {
return false;
}
public boolean equals(Object x, Object y) throws HibernateException {
return x == y;
}
public String getName() {
return "clob";
}
public String toXML(Object val) throws HibernateException {
return val.toString();
}
}
|