I am using querydsl-maven-plugin
in order to export Q paths from an Oracle 11g database. The problem I am facing is that Oracle NUMBER
fields are mapped to NumberPath<java.math.BigDecimal>
instead of NumberPath<Long>
Is there any way I can instruct querydsl-maven-plugin
to translate BigDecimal
to Long
during code generation?
The approach I am taking right now is to use the plugin to generate the code and then translate types by hand.
Any hints would be appreciated.
It is currently possible to declare custom user types in the configuration of the querydsl-maven-plugin like this
<configuration>
<customTypes>
<customType>com.example.NumericLongType</customType>
</customTypes>
</configuration>
com.example.NumericLongType would need to implement the com.mysema.query.sql.types.Type interface
But ideally this should be something like this
<configuration>
<overrides>
<NUMERIC>java.lang.Long</NUMERIC>
</overrides>
</configuration>
and Querydsl would handle the mapping from NUMERIC to Long internally.
Feel free to open a ticket for it.
Update
Numeric mappings are now customizable in Querydsl https://github.com/mysema/querydsl/issues/273
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With