Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java field name clashes #212

Closed
jvmakine opened this issue Aug 10, 2012 · 5 comments
Closed

Java field name clashes #212

jvmakine opened this issue Aug 10, 2012 · 5 comments

Comments

@jvmakine
Copy link

@jvmakine jvmakine commented Aug 10, 2012

Hi,

Using QueryDSL 2.7.2 and Oracle 10g express edition, when I export a schema with table containing two foreign key references named REF_FOO_BAR and REF_FOO_BAR_ the generated Java code is invalid as it contains two fields with identical names for these constraints.

Regards,
Juho

@timowest
Copy link
Member

@timowest timowest commented Aug 11, 2012

They are actually different. If you use the DefaultNamingStrategy you will get

REFFOO_BAR -> reffooBar
REF_FOO_BAR -> refFooBar

I assume these are dummy examples, so could you give me examples that are closer to your real foreign key names?

timowest added a commit that referenced this issue Aug 11, 2012
@jvmakine
Copy link
Author

@jvmakine jvmakine commented Aug 13, 2012

Hi!

My apologies. It seems the github comment formatter has changed the reference names in my previous post. The actual names are

    REF_FOO_BAR
    REF_FOO_BAR_

So the names are identical except for the additional underscore at the end of one of the names.

Regards,
Juho

@timowest
Copy link
Member

@timowest timowest commented Aug 13, 2012

I will change the DefaultNamingStrategy to preserve trailing underscores unless you have a better idea how to solve this. Using the OriginalNamingStrategy would also solve the problem, but then you wouldn't have camelcase property names.

@jvmakine
Copy link
Author

@jvmakine jvmakine commented Aug 13, 2012

Thank you for the fast reply. Preserving the trailing underscores would indeed seem like the best solution for this problem.

@timowest
Copy link
Member

@timowest timowest commented Sep 10, 2012

Released in 2.7.3

@timowest timowest closed this Sep 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants