hi @all,
i'm a newbie in topic hibernate and develop my first project whit it. now i have a problem in storing datas to my database. my class-hierarchy looks like the following:
-------------------------
| person |
| |
-------------------------
/|\
|
------------------------- -------------------------
| customer |1 n| account |
| |--------------------| |
------------------------- -------------------------
customer inherit from person. customer has one or more accounts. the mapping lokes like:
Code:
<class name="Person" table="Person">
......
<joined-subclass name="customer" table="customer">
<key column="id" ></key>
<property name="..." type="...">
<column name="..."/>
</property>
......
<many-to-one name="account" column="account_id" class="Account" cascade="all" lazy="false"/>
</joined-subclass>
......
</class>
with this mapping i get the follow exception:
org.hibernate.exception.GenericJDBCException: could not insert: [customer]
when i delete the line containing the "many-to-one"-relation it works.
thx for help