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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 2, 2014

Member

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

Member

timowest commented Sep 2, 2014

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

@laurimak

This comment has been minimized.

Show comment
Hide comment
@laurimak

laurimak Sep 2, 2014

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

laurimak commented Sep 2, 2014

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

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 2, 2014

Member

Ok. Could you also provide the full stacktrace?

Member

timowest commented Sep 2, 2014

Ok. Could you also provide the full stacktrace?

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 8, 2014

Member

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.

Member

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

@Shredder121 Shredder121 closed this in #1087 Dec 19, 2014

@timowest timowest removed the progress label Mar 13, 2015

@RazmikMkrtchyan

This comment has been minimized.

Show comment
Hide comment
@RazmikMkrtchyan

RazmikMkrtchyan 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.

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