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?