ClassCastException in EnumByNameType When Setting To Null #309

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

Comments

Projects
None yet
2 participants
@ssaarela
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@ssaarela

ssaarela Dec 3, 2012

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Dec 3, 2012

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 13, 2013

Member

Released in 3.0.0.BETA1

Member

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