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

ClassCastException in EnumByNameType When Setting To Null #309

Closed
ssaarela opened this issue Dec 3, 2012 · 3 comments
Closed

ClassCastException in EnumByNameType When Setting To Null #309

ssaarela opened this issue Dec 3, 2012 · 3 comments
Milestone

Comments

@ssaarela
Copy link
Contributor

@ssaarela ssaarela commented Dec 3, 2012

SQLUpdate update =...;

update.set(qType.enumValue, null);

=>

Caused by: java.lang.ClassCastException: com.mysema.query.sql.types.Null cannot be cast to java.lang.Enum
at com.mysema.query.sql.types.EnumByNameType.setValue(EnumByNameType.java:26) ~[querydsl-sql-2.9.0.jar:na]
at com.mysema.query.sql.Configuration.set(Configuration.java:111) ~[querydsl-sql-2.9.0.jar:na]

@ssaarela
Copy link
Contributor Author

@ssaarela ssaarela commented Dec 3, 2012

The problem is that Configuration.getType > JavaTypeMapping.getType > typeByColumn returns EnumByValueType instead of UntypedNullType (or NullType - what's the difference?) which is returned in case of e.g. StringPath. Null expression should override typed access.

@timowest
Copy link
Member

@timowest timowest commented Dec 3, 2012

UntypedNullType is used for cases where parameter metadata is not available. It's used internally in Querydsl SQL for CUBRID, MySQL and Oracle.

@timowest
Copy link
Member

@timowest timowest commented Jan 13, 2013

Released in 3.0.0.BETA1

@timowest timowest closed this Jan 13, 2013
@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants