-->
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.  [ 3 posts ] 
Author Message
 Post subject: Versioning in a subclass
PostPosted: Thu Jun 12, 2008 12:14 pm 
Newbie

Joined: Thu Jun 12, 2008 11:50 am
Posts: 2
Is there any way to apply versioning concepts to a subclass. We have 3rd party application that uses hibernate which I can extend from but cannot modify (mapping files are hidden away in a jar file). In order to extend I've created the below mapping file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<subclass name="customepackaging.versioningTest" extends="XXXXXXXXXXXXXXXXXXXXXXXX" discriminator-value="myVersioning">
<join table="CustomVersioning">
<key>
   <column name="ID"/>
</key>
</join>
<version name="myVersioning" column="version" type="int"/>
</subclass>
</hibernate-mapping>


the above file generates the following exception:
Code:
Caused by: org.xml.sax.SAXParseException: The content of element type "subclass" must match "(meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,join*,subclass*,loader?,sql-insert?,sql-update?,sql-delete?,resultset*,(query|sql-query)*)".
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
   at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.dom4j.io.SAXReader.read(SAXReader.java:465)
   at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:422)


Is there any way to apply versioning on my subclass without modifying the actual 3rd party hbm file where the subclass extends from?

Many thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 12, 2008 5:05 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 2:42 pm
Posts: 77
Location: The Netherlands
Why don't you implement it yourself ?
Have a look at the documentation or better even the hibernate bible. The versioning has many options these days


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 13, 2008 4:57 am 
Newbie

Joined: Thu Jun 12, 2008 11:50 am
Posts: 2
I did look at the documentation before I posted this issue here. The problem is that I don't have access to the src or the hbm files where the actual classes are kept (they are jared up as 3rd party app).

All the documentation/tutorials that I looked at suggested either using a class file or hbm. I can put a tigger in database and let the trigger control the versioning but it's not very elagent.

All I can do is to extend the base class and provide mapping but then I can't use VERSION element.

Is there any other way?


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

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.