-->
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: Where does this foreign key contraint come from?
PostPosted: Thu Jun 16, 2005 6:40 am 
Newbie

Joined: Sat Jun 11, 2005 5:27 am
Posts: 11
3.0:

This is a simple parent-child relation

Mapping documents:

in "Source"

Code:
        <set name="jobs" order-by="firstSeen" inverse="true">
            <meta attribute="field-description">
                Jobs from this source
            </meta>
            <key column="source_id"/>
            <one-to-many class="jobfinder.data.Job"/>
       
           
        </set>


in "Job":

Code:
       <many-to-one class="jobfinder.data.Source" name="source" column="source_id" lazy="false">
            <meta attribute="field-description">
                Where job found
            </meta>
       </many-to-one>


ExportSchema generates the following contraints on "job"

Code:
alter table job
    add constraint FK19BBD79457373
    foreign key (source_id)
    references source;
alter table job
    add constraint FK19BBDAB343541
    foreign key (contact_id)
    references contact;
alter table job
    add constraint FK19BBD99AD0491
    foreign key (job_id)
    references source;


The first two are fine but I don't understand where the third is coming from. I was unable to save job entities until I dropped this extra constraint.

job_id is, of course, the synthetic key of the job table and definitely doesn't point to source.

Name and version of the database you are using:

Postgressql


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.