-->
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: prostgres foreign-key generation not working?
PostPosted: Fri Sep 23, 2005 5:50 am 
Newbie

Joined: Fri Sep 23, 2005 5:33 am
Posts: 1
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


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.