

Public Member Functions | |
| Object | nullSafeGet (ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException |
| void | nullSafeSet (PreparedStatement st, Object value, int index) throws HibernateException, SQLException |
Static Private Attributes | |
| static final String | COM_MCHANGE_V2_C3P0 = "com.mchange.v2.c3p0" |
| static final String | ORACLE_JDBC = "oracle.jdbc" |
| static final String | GET_STRING_VAL = "getStringVal" |
| static final String | XML_TYPE = "oracle.xdb.XMLType" |
| static final long | serialVersionUID = 2838406736360323902L |
A hibernate UserType that supports the Oracle XMLTYPE.
Because we store the XMLTYPE as a String in our domain class it seems adequate to inherit StringClobType's implementation of everything except: nullSafeGet() and nullSafeSet()
To use this class in your domain class add the following above the class declaration (where the @Entity is):
@TypeDef(name = "xmltype", typeClass = HibernateXmlType.class)
Then add this to the Java Strings that map Oracle XMLTYPEs in the DB:
@Type(type = "xmltype")
NOTE(rtobar): When we integrated Robert's class into ACS, we modified it to use reflection so that we get no errors if the Oracle jars are not on the classpath. Reflection is also used for inspecting for C3P0 classes. If classes are not found, then simply the old CLOB behavior will be used.
| Object alma::hibernate::util::HibernateXmlType::nullSafeGet | ( | ResultSet | rs, | |
| String[] | names, | |||
| Object | owner | |||
| ) | throws HibernateException, SQLException [inline] |
References COM_MCHANGE_V2_C3P0, GET_STRING_VAL, ORACLE_JDBC, and XML_TYPE.
| void alma::hibernate::util::HibernateXmlType::nullSafeSet | ( | PreparedStatement | st, | |
| Object | value, | |||
| int | index | |||
| ) | throws HibernateException, SQLException [inline] |
final String alma::hibernate::util::HibernateXmlType::COM_MCHANGE_V2_C3P0 = "com.mchange.v2.c3p0" [static, private] |
Referenced by nullSafeGet().
final String alma::hibernate::util::HibernateXmlType::GET_STRING_VAL = "getStringVal" [static, private] |
Referenced by nullSafeGet().
final String alma::hibernate::util::HibernateXmlType::ORACLE_JDBC = "oracle.jdbc" [static, private] |
Referenced by nullSafeGet(), and nullSafeSet().
final long alma::hibernate::util::HibernateXmlType::serialVersionUID = 2838406736360323902L [static, private] |
final String alma::hibernate::util::HibernateXmlType::XML_TYPE = "oracle.xdb.XMLType" [static, private] |
Referenced by nullSafeGet(), and nullSafeSet().
1.6.2