alma::hibernate::util::HibernateXmlType Class Reference

Inheritance diagram for alma::hibernate::util::HibernateXmlType:
Inheritance graph
[legend]
Collaboration diagram for alma::hibernate::util::HibernateXmlType:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.

Author:
rkurowsk, Jan 22, 2010

Member Function Documentation

Object alma::hibernate::util::HibernateXmlType::nullSafeGet ( ResultSet  rs,
String[]  names,
Object  owner 
) throws HibernateException, SQLException [inline]
void alma::hibernate::util::HibernateXmlType::nullSafeSet ( PreparedStatement  st,
Object  value,
int  index 
) throws HibernateException, SQLException [inline]

Member Data Documentation

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().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2