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

Wrong type in code generation #344

Closed
mgiammarco opened this issue Feb 14, 2013 · 5 comments
Closed

Wrong type in code generation #344

mgiammarco opened this issue Feb 14, 2013 · 5 comments
Milestone

Comments

@mgiammarco
Copy link

@mgiammarco mgiammarco commented Feb 14, 2013

With database postgresql 9.1 the jpa code generator converts correctly numeric->Short.
The sql code generator converts numeric->Boolean which is not correct.

Mario

@timowest
Copy link
Member

@timowest timowest commented Feb 14, 2013

Which Querydsl version are you using? The latest version maps Boolean to BIT, BOOLEAN and NUMBER(1).

@mgiammarco
Copy link
Author

@mgiammarco mgiammarco commented Feb 14, 2013

I am using version 2.9.0. In postgres there is "numeric" type that I
suppose is like NUMBER. But is mapping number(1) to Boolean too aggressive?
I suppose I am in this case.

2013/2/14 Timo Westkämper notifications@github.com

Which Querydsl version are you using? The latest version maps Boolean to
BIT, BOOLEAN and NUMBER(1).


Reply to this email directly or view it on GitHubhttps://github.com//issues/344#issuecomment-13575768.

@timowest
Copy link
Member

@timowest timowest commented Feb 15, 2013

The mapping range for numbers is this one

19-...,0   -> Long
6-18,0     -> Integer
4-5,0      -> Short
2-3,0      -> Byte
1,0        -> Boolean

17-...,?   -> BigDecimal
0-16,?     -> Double

I will make sure this is reasonable also for Postgres

@timowest
Copy link
Member

@timowest timowest commented Feb 15, 2013

I just tuned the integer mappings to this

19-...,0   -> Long
6-18,0     -> Integer
3-5,0      -> Short
1-2,0      -> Byte
0          -> Boolean
timowest added a commit that referenced this issue Feb 15, 2013
@timowest
Copy link
Member

@timowest timowest commented Feb 20, 2013

Released in 3.0.0.BETA2

@timowest timowest closed this Feb 20, 2013
@timowest timowest added this to the 3.0.0 milestone Apr 14, 2014
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