-->
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: upon saving childs generator sequence isn't called
PostPosted: Wed May 25, 2005 3:57 am 
Beginner
Beginner

Joined: Thu Sep 16, 2004 4:36 am
Posts: 22
Hi all

simple inheritance, but the child class doesn't get it's sequence called.
Upon show_sql=true i see that hibernate selects the nextval for the parentclass (the one that is saved) but never the nextval for the child class.

mapping:

class A: <?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping auto-import="false" >
<class name="A"
table="A"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
>

<id
name="idInternal"
column="idInternal"
type="long"
unsaved-value="-1"
>
<generator class="sequence">
<param name="sequence">A_sequence</param></generator>
</id>
<some properties here>
<list
name="BInternal"
table="A_B"
lazy="false"
inverse="false"
cascade="all-delete-orphan"
where="B_index is not null"
>

<key
column="A_id"
>

</key>

<index
column="B_index"
/>

<one-to-many
class="B"
/>
</list>
</class>
</hibernate-mapping>

class B:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping
auto-import="false"
>
<class
name="B"
table="B"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
>

<id
name="idInternal"
column="idInternal"
type="long"
unsaved-value="-1"
>
<generator class="sequence">
<param name="sequence">B_sequence</param> </generator>

</id>
<some properties here>
</class>
</hibernate-mapping>


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.