-->
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: OneToOne mapping with embeddedId
PostPosted: Mon Oct 19, 2009 3:44 pm 
Newbie

Joined: Mon Aug 15, 2005 3:43 am
Posts: 15
Hibernate version 3.4, annotation based, database Postgres8.3
I need to have a OneToOne mapping with embeddedId. The problem is hbm2ddl confuses the embeddedId columns.
This is how the mapping looks like:

Code:
  @EmbeddedId
    @AttributeOverrides( {
       @AttributeOverride(name = "triggerName", column = @Column(name = "trigger_name", nullable = false, length = 200)),
       @AttributeOverride(name = "triggerGroup", column = @Column(name = "trigger_group", nullable = false, length = 200)) })
    public QrtzTriggersId getId() {
   return this.id;
    }


The other one :
Code:
@OneToOne
    public QrtzTrigger getQrtzTigger() {
        return qrtzTigger;
    }



The foriegn key it creates is as follow:
Code:
CONSTRAINT fk7fad854f78f9131b FOREIGN KEY (qrtztigger_trigger_group, qrtztigger_trigger_name)
      REFERENCES qrtz_triggers (trigger_name, trigger_group) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION

As you can see, it mappes name to group and group to name, as result any insertion to the table fails.
I need to know if I missed something here, or is it a bug?


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.