[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-1009) @JoinColumn on association with composite foreign key needs referencedColumnName

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Fri Nov 2 14:31:29 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-1009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28677 ] 

Max Rydahl Andersen commented on HBX-1009:
------------------------------------------

i added the referencedcolumnname for the places where I can currently easily identify them (joins to PK)

And we are using whatever is in JBoss EAP :)

> @JoinColumn on association with composite foreign key needs referencedColumnName
> --------------------------------------------------------------------------------
>
>                 Key: HBX-1009
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1009
>             Project: Hibernate Tools
>          Issue Type: Bug
>          Components: hbm2java
>            Reporter: Gavin King
>         Attachments: test-schema.txt
>
>
> Its not ok to generate this:
> 	@JoinColumns( { @JoinColumn(name = "make"), @JoinColumn(name = "model"),
> 			@JoinColumn(name = "year") })
> You need the referencedColumnNames.
> Incidently, is all this noisy crap really necessary?
> 	@EmbeddedId
> 	@AttributeOverrides( {
> 			@AttributeOverride(name = "make", column = @Column(name = "make", nullable = false, length = 20)),
> 			@AttributeOverride(name = "model", column = @Column(name = "model", nullable = false, length = 30)),
> 			@AttributeOverride(name = "year", column = @Column(name = "year", nullable = false)) })
> 	@NotNull
> 	public ModelYearId getId() {
> 		return this.id;
> 	}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list