Java field name clashes #212

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

Comments

Projects
None yet
2 participants
@jvmakine

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Aug 11, 2012

Member

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?

Member

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

This comment has been minimized.

Show comment
Hide comment
@jvmakine

jvmakine 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

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Aug 13, 2012

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@jvmakine

jvmakine Aug 13, 2012

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

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

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 10, 2012

Member

Released in 2.7.3

Member

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