[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-7307) referencedColumnName is being ignored for OneToOne mapping
Hardy Ferentschik (JIRA)
noreply at atlassian.com
Wed May 9 09:41:09 EDT 2012
[ https://hibernate.onjira.com/browse/HHH-7307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hardy Ferentschik updated HHH-7307:
-----------------------------------
Description:
Using a soft key instead of FK is necessary for legacy DB's and currently 4.1.2 has issues with this. I am using:
{code}
@OneToOne(fetch = FetchType.LAZY)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumns({
@JoinColumn(name = "id", referencedColumnName="houseId", nullable = true, insertable = false, updatable = false)
})
public Child getChild(){
return this.child;
}
{code}
but SQL shows join is based on PK and not Soft Key "houseId"
@OneToOne mapping will force a FK-PK relationship and ignores values for "referencedColumnName" attributes:
Inspecting code from AnnotationBinder and OneToOne shows few FIXME and TODO tags like:
{noformat}
//FIXME referencedColumnName ignored
{noformat}
was:
Using a soft key instead of FK is necessary for legacy DB's and currently 4.1.2 has issues with this. I am using:
@OneToOne(fetch = FetchType.LAZY)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumns({
@JoinColumn(name = "id", referencedColumnName="houseId", nullable = true, insertable = false, updatable = false)
})
public Child getChild(){
return this.child;
}
but SQL shows join is based on PK and not Soft Key "houseId"
@OneToOne mapping will force a FK-PK relationship and ignores values for "referencedColumnName" attributes:
Inspecting code from AnnotationBinder and OneToOne shows few FIXME and TODO tags like:
//FIXME referencedColumnName ignored
> referencedColumnName is being ignored for OneToOne mapping
> ----------------------------------------------------------
>
> Key: HHH-7307
> URL: https://hibernate.onjira.com/browse/HHH-7307
> Project: Hibernate ORM
> Issue Type: Bug
> Components: core
> Affects Versions: 4.1.2
> Reporter: farhad ch
> Priority: Critical
>
> Using a soft key instead of FK is necessary for legacy DB's and currently 4.1.2 has issues with this. I am using:
>
> {code}
> @OneToOne(fetch = FetchType.LAZY)
> @NotFound(action = NotFoundAction.IGNORE)
> @JoinColumns({
> @JoinColumn(name = "id", referencedColumnName="houseId", nullable = true, insertable = false, updatable = false)
> })
> public Child getChild(){
> return this.child;
> }
> {code}
> but SQL shows join is based on PK and not Soft Key "houseId"
> @OneToOne mapping will force a FK-PK relationship and ignores values for "referencedColumnName" attributes:
> Inspecting code from AnnotationBinder and OneToOne shows few FIXME and TODO tags like:
> {noformat}
> //FIXME referencedColumnName ignored
> {noformat}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list