I am trying to integrate Hibernate with an Oracle XMLType column and I have been successful in doing so, thanks to this great blog posting:
http://mosisa.wordpress.com/2008/07/14/hibernate-with-oracle-xmltype/. However, Oracle allows a XMLType column to be bound to a schema internally, and this binding happens when the table is created. An example of the complete Oracle SQL Statement is:
Code:
CREATE TABLE dev.xml_record (id NUMBER, xmlcol XMLType)
XMLType COLUMN xmlcol
XMLSCHEMA "xmlSchema"
ELEMENT "record";
The schema referenced (xmlSchema) has already been loaded into the database. I have been able through the used of a Custom Dialect and UserType to get Hibernate's SchemaExport to generate the following SQL:
Code:
CREATE TABLE dev.xml_record (id NUMBER, xmlcol XMLType)
As you can see, the SQL is still missing the remaining schema mapping content. I would like to essentially use the Dialect.getTableTypeString() feature to add the remaining text to the table creation script for this table only, but it appears that the design of this feature will apply this text to the end of ALL tables generated. Does anybody know another way to get the additional SQL added when generating the schema?