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>
|
|