<property name="lineCoordinateClob" type="java.sql.Clob">
<column name="LINE_COORDINATE_CLOB">
<comment>线路坐标</comment>
</column>
</property>
【bean】
private String lineCoordinate;
private Clob lineCoordinateClob;
public String getLineCoordinate() {
//return this.lineCoordinate;
//给clob赋值的同时给String赋值 clob to string
try {
if (lineCoordinateClob!=null) {
this.lineCoordinate=lineCoordinateClob.getSubString(1, (int) lineCoordinateClob.length());
}
} catch (SQLException e) {
e.printStackTrace();
}
return this.lineCoordinate;
}
public void setLineCoordinate(String lineCoordinate) {
this.lineCoordinate = lineCoordinate;
//string to clob zjb 20140909
if (lineCoordinate!=null) {
this.lineCoordinateClob=Hibernate.createClob(lineCoordinate);
}
}
public Clob getLineCoordinateClob() {
return lineCoordinateClob;
}
public void setLineCoordinateClob(Clob lineCoordinateClob) {
this.lineCoordinateClob = lineCoordinateClob;
}