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

Registering numeric type for Boolean in Oracle does not work if Boolean value is null #921

Closed
laurimak opened this issue Sep 2, 2014 · 5 comments
Labels
bug
Milestone

Comments

@laurimak
Copy link

@laurimak laurimak commented Sep 2, 2014

Registering Booleans to be converted to number type does not work with the following configuration.

com.mysema.query.sql.Configuration configuration = new com.mysema.query.sql.Configuration(templates());
        configuration.registerNumeric(1, 0, Boolean.class);

This result in IllegalArgumentException in insert statement as follows.

Caused by: java.lang.IllegalArgumentException: java.sql.SQLException: Invalid column type: 16
    at com.mysema.query.sql.dml.AbstractSQLClause.setParameters(AbstractSQLClause.java:83) ~[querydsl-sql-3.2.4.jar:na]
    at com.mysema.query.sql.dml.SQLInsertClause.prepareStatementAndSetParameters(SQLInsertClause.java:274) ~[querydsl-sql-3.2.4.jar:na]
    at com.mysema.query.sql.dml.SQLInsertClause.createStatement(SQLInsertClause.java:235) ~[querydsl-sql-3.2.4.jar:na]
    at com.mysema.query.sql.dml.SQLInsertClause.execute(SQLInsertClause.java:313) ~[querydsl-sql-3.2.4.jar:na]

Configuring Boolean to numeric mapping in the following manner seems to be a workaround for this problem.

com.mysema.query.sql.Configuration configuration = new com.mysema.query.sql.Configuration(templates());
        configuration.register(new BooleanType(Types.NUMERIC));
@timowest
Copy link
Member

@timowest timowest commented Sep 2, 2014

Thanks for the issue. Which version of Querydsl do you use?

@laurimak
Copy link
Author

@laurimak laurimak commented Sep 2, 2014

Sorry, forgot to mention the version in my haste. The Querydsl version is 3.2.4.

@timowest
Copy link
Member

@timowest timowest commented Sep 2, 2014

Ok. Could you also provide the full stacktrace?

@timowest
Copy link
Member

@timowest timowest commented Sep 8, 2014

Instead of the full stacktrace you can of course also provide something with the relevant call. The stacktrace you gave me is a wrapped one.

@timowest timowest added the bug label Dec 14, 2014
@timowest timowest added this to the 4.0.0 milestone Dec 14, 2014
@timowest timowest removed the progress label Mar 13, 2015
@RazmikMkrtchyan
Copy link

@RazmikMkrtchyan RazmikMkrtchyan commented Dec 15, 2016

untitled
I think the bug is still actual.
I use Oracle and if my Boolean values are null,then occured java.sql.SQLException: Invalid column type: 16:

p.s. I am using the 3.7.4 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.