]
Steve Ebersole commented on HIBERNATE-142:
------------------------------------------
As already mentioned, this is not the right place to report this. Also, I am fairly
certain this has since been resolved.
@JoinColumn annotation doesn't fully support column names
requiring double-quotes
---------------------------------------------------------------------------------
Key: HIBERNATE-142
URL:
https://issues.jboss.org/browse/HIBERNATE-142
Project: Hibernate Integration
Issue Type: Bug
Environment: Hibernate 4.2.4-Final
Eclipse Juno
J2EE 3.0 Web app
Reporter: Paul Spinelli
Assignee: Steve Ebersole
Priority: Minor
Due to the way an existing database schema has been configured, my JPA annotations (using
Hibernate as my provider) all required that table names/column names be double-quoted:
(e.g. String ID_COLUMN_NAME = "\"Id\"";)
This does not pose a problem EXCEPT when using the @JoinColumn annotation (specifically,
the 'referencedColumnName' attribute). This DOES NOT work (I get an error that the
logical column name cannot be found):
@JoinColumn(name=ID_COLUMN_NAME, referencedColumnName=ID_COLUMN_NAME)
However, this DOES work:
@JoinColumn(name=ID_COLUMN_NAME, referencedColumnName="`Id`")
It seems that the 'name' attribute supports double-quotes while the
'referencedColumnName' attribute does not. Is there a reason it should not?