Hi All
I am sure that this has been covered before, and I have read the Parent/Child doc.
But I am getting the following error:
key referenced from consumer_contact not found in consumer_brand
I am working against an postgresql db, and use SEQUENCE to generate the id's.
Now I am adding a new parent, and a new child, and I have added the child object to the parent, and the parent object to the child.
Any pointers would be helpful.
thanks
Jeff Singer
Here are snippets from my meta files:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<!--
Created by Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
<class name="za.co.vine.consumerManagement.binding.hibernate.ConsumerBrand" table="consumer_brand">
<id name="consumerBrandId" type="int" column="consumer_brand_id">
<generator class="sequence">
<param name="sequence">hibernate_sequence</param>
</generator>
</id>
<property name="permission" type="boolean" column="permission" length="1"/>
<property name="dateRecruited" type="java.sql.Date" column="date_recruited" length="4"/>
<!-- bi-directional one-to-many association to ConsumerContact -->
<set name="consumerContacts" inverse="true" cascade="all">
<key column="consumer_brand_id" />
<one-to-many class="za.co.vine.consumerManagement.binding.hibernate.ConsumerContact"/>
</set>
</class>
</hibernate-mapping>
and
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<!--
Created by Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
<class name="za.co.vine.consumerManagement.binding.hibernate.ConsumerContact" table="consumer_contact">
<id name="consumerContactId" type="int" column="consumer_contact_id">
<generator class="sequence">
<param name="sequence">hibernate_sequence</param>
</generator>
</id>
<property name="contact" type="java.lang.String" column="contact" length="-1"/>
<property name="incorrectContactCount" type="java.math.BigDecimal" column="incorrect_contact_count" length="65535"/>
<property name="optIn" type="boolean" column="opt_in" length="1"/>
<!-- associations -->
<!-- bi-directional many-to-one association to ConsumerBrand -->
<many-to-one name="consumerBrand" class="za.co.vine.consumerManagement.binding.hibernate.ConsumerBrand" not-null="true" cascade="all" column="consumer_brand_id" />
<!-- bi-directional many-to-one association to ContactType -->
<many-to-one name="contactType" class="za.co.vine.consumerManagement.binding.hibernate.ContactType" not-null="true" cascade="all">
<column name="contact_type_id"/>
</many-to-one>
</class>
</hibernate-mapping>