1

I've run into a problem concerning the mapping of DB column types to JAVA types in the generated metadata classes generated from the querydsl-maven-plugin.

We have a Oracle DB column with the following definition

priority number(1,0) not null default(5)

which takes integers from 1 to 9.

Now the metadata generator maps the column type specification to Boolean (which IMHO is anyway a wrong interpretation of the DB column).

Is there a possiblity, to configure the maven plugin such that I can provide a different type mapping for some table/column pairs or for some DB data types?

Although I could set up the metadata generation with a separate JAVA program this is not an option because I want to keep my build as it is.

Version of QueryDSL is 3.2.4.

Any help appreciated.

EDIT: An alternative may be that in the select list some typecasting is done.

M. Lindenmann
  • 81
  • 1
  • 2
  • 6

1 Answers1

1

This is currently not possible, but I created a ticket for it https://github.com/mysema/querydsl/issues/577

I will also look into the default numeric mappings again.

Timo Westkämper
  • 21,824
  • 5
  • 78
  • 111
  • Hi Timo, kind regards for the quick reaction. I would suggest finding a solution which allows for arbitrary type mappings for a column. The reason is that I already have run into a similar problem. where the column is `char(1)`, the metadata generator returns a `StringPath` for this column and the data extraction returns a `Character`. All together winds up in a `ClassCastException` for which I did not find a solution yet. – M. Lindenmann Dec 02 '13 at 14:09