Errors when using mixed-case column name in @JoinColumn

Description

Given a class like the following:

If the gameSessionId column in the actual DB matches that mixed casing, I get errors like this:

That error is from running against an HSQL DB: it's unhappy that the column's name isn't all-uppercase. I get similar errors with Postgres, too, except that it's unhappy that the column's name isn't all-lowercase.

From some debugging, the problem in the code looks to be at CopyIdentifierComponentSecondPass.doSecondPass(Map):160 (for the 4.3.6 release's source): the Column instance created for the SQL statement is built from the already-parsed-and-so-has-no-backticks representation of the metadata column name, rather than the "raw" column name with the backticks from the metadata. Of course, I have no clue where that raw version of the name is actually maintained, so I couldn't tell you how to resolve this. Apologies!

I'm using mixed case column names in all of my entities, but this is my only @JoinColumn so far. Not seeing problems like this with the rest of my code.

Activity

Show:

Steve Ebersole October 28, 2015 at 3:26 AM

As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.

Steve Ebersole October 27, 2015 at 7:16 PM

This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.

For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/

Karl M. Davis October 4, 2014 at 1:37 AM

Oh, just realized that this may be a bit more complicated than described above: these errors didn't use to appear. They only started when I went through and started addressing the JPA spec validation "errors" I had in Eclipse. Those included the fact that I had @Entity classes and fields marked as final, and that the GameRound.GameRoundPk @IdClass on this class needed to be tweaked: one of its fields was incorrectly an int, rather than a GameSession.GameSessionPk reference. As part of fixing that, I had to create the GameSession.GameSessionPk class.

Unfortunately, I have no clue which of those fixes was the trigger for this issue.

Details

Assignee

Unassigned

Reporter

Affects versions

Priority

Created October 3, 2014 at 4:10 AM
Updated February 26, 2016 at 4:04 PM
Loading...