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

Code generation should use JDBC constants #850

Closed
bbakerman opened this Issue Jul 14, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@bbakerman
Contributor

bbakerman commented Jul 14, 2014

One strategy around code generation is to "seed" the database entities early in the project life and then hand maintain them after that.

To that end the way the 3.4.1 code gen should be improved to put in JDBC constants that a human could understand

        addMetadata(CREATED_DATE, ColumnMetadata.named("CREATED_DATE").withIndex(1).ofType(93).withSize(29).withDigits(6).notNull());

with withIndex(1) and ofType(93) etc... would be more maintainable with symbolic constants.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jul 15, 2014

Member

withIndex, withSize and withDigits don't use any magic constants, but ofType could use the JDBC types constants instead. What do you think?

Member

timowest commented Jul 15, 2014

withIndex, withSize and withDigits don't use any magic constants, but ofType could use the JDBC types constants instead. What do you think?

@bbakerman

This comment has been minimized.

Show comment
Hide comment
@bbakerman

bbakerman Jul 17, 2014

Contributor

Sure I think the use of Type.CONSTANT would be a benefit for any one want to maintain the generated code over time.

Contributor

bbakerman commented Jul 17, 2014

Sure I think the use of Type.CONSTANT would be a benefit for any one want to maintain the generated code over time.

@timowest timowest added the fixed label Jul 17, 2014

@timowest timowest added this to the 3.4.2 milestone Jul 17, 2014

@timowest timowest modified the milestone: 3.4.2 Jul 19, 2014

@timowest timowest removed the fixed label Jul 19, 2014

@timowest timowest closed this Jul 19, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jul 29, 2014

Member

Released in 3.4.2

Member

timowest commented Jul 29, 2014

Released in 3.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment