I have a ont-to-many constraint in my database schema and it's basically working allright when running java code.
When I check the generated schema on my postgreSQL Server I don't see that Hibernate really created a foreign-key constraint.
But at the same time it Hibernate wants to drop this foreign key on creation (what fails).
Here's the simple question:
Can hibernate create foreign-key in PostgresSQL?
If yes, what Do I have to do for this in general?
Thanks in advance!
Code:
<hibernate-mapping>
<class name="Parent" table="parent">
<id name="parentId"/>
<property name="name" column="name" />
<set name="children" cascade="all" lazy="true">
<key column="parent_id" />
<one-to-many class="Child" />
</set>
</class>
<class name="Child" table="child">
<id name="childId" column="child_id">
<generator class="uuid.hex" />
</id>
<property name="userId" column="parent_id" />
<property name="sigData" column="child_data" />
</class>
</hibernate-mapping>
Hibernate version: 3.0
Name and version of the database you are using: PostgreSQL 8