-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Oracle XMLType Columns and Hibernate SchemaExport
PostPosted: Mon Jun 08, 2009 11:01 am 
Newbie

Joined: Mon Jun 08, 2009 10:21 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.