-->
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.  [ 4 posts ] 
Author Message
 Post subject: Back to replication foo
PostPosted: Mon Feb 09, 2004 3:25 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
I left topic on this hanging a couple of weeks ago, but now I'm back to it. Still having a problem with replication. I've got a JIRA submission ready to go on this.

When I try to replicate a joined-subclass with a list, I get an SQL error if the list index property is set to not-null="true"

Mapping:
Code:
<hibernate-mapping default-cascade="save-update">
   
    <class name="com.foo.bar.DataObject" schema="base" table="data_objects">
       
        <id name="id" type="long">
            <generator class="native"/>
        </id>
       
        <version name="version" type="timestamp" unsaved-value="null"/>

        <joined-subclass name="com.foo.bar.DataSubclass" schema="base" table="data_subclasses">
       
            <key><column name="id"/></key>
           
            <property name="name" type="string" not-null="true" unique="true">
                <meta attribute="use-in-tostring">true</meta>
            </property>
           
            <list name="items" lazy="false" inverse="false">
                <key column="parent"/>
                <index column="collection_order"/>
                <one-to-many class="com.foo.bar.CollectionData"/>
            </list>
                   
        </joined-subclass> <!-- DataSubclass -->
       
        <joined-subclass name="com.foo.bar.CollectionData" schema="base" table="collection_data">
       
            <key><column name="id"/></key>
       
            <!-- Only works when not-null="false" -->
            <property name="collectionOrder" type="integer" column="collection_order" not-null="true" unique="false"/>
           
            <many-to-one name="parent" class="com.foo.bar.DataSubclass"/>
           
            <property name="data" type="string" not-null="false" unique="false"/>
           
        </joined-subclass> <!-- ListData -->
       
    </class> <!-- DataObject -->

</hibernate-mapping>


When I perform a straight replication of all DataObjects from one DB to another, any DataSubclass with a list of CollectionData objects causes an error. The SQL "update base.collection_data set parent=null, collection_order=null where parent=?" is sent to the DB, and collection_order has a not-null constraint.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2004 6:43 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
Any ideas? Anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2004 10:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I thought you said you had a JIRA issue?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2004 4:15 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
Sorry, I was waiting for "approval." :)

http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-703


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.