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

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

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

@mgiammarco
Copy link
Author

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

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

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

Released in 3.0.0.BETA2

@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
Development

No branches or pull requests

2 participants