JPASQL: Calling in() on EnumPath causes enum types to be serialized

408 views
Skip to first unread message

nyc2

unread,
May 17, 2013, 3:01:54 AM5/17/13
to quer...@googlegroups.com
Hi,

Unfortunately, I am getting no results when searching for a collection of enum types with JPASQL.

In QType:
public final EnumPath<MyEnum> foo = createEnum("my_enum", MyEnum.class);

Query:
new JPASQLQuery(getEntityManager(), new SQLServerTemplates()).from(QType).where(QType.foo.in(MyEnum.A1, MyEnum.A2)).list(QType.foo);

SQL Server Profiler revealed that enum parameters were passed to the database in a serialized form (0xACE...) instead of enum ordinals. This is why there are no results.

Can you reproduce this issue? If so, what would you suggest?

By the way, I am using Querydsl 2.6.0 and Hibernate 3.2.4.


Best regards, 
nyc2



Timo Westkämper

unread,
May 17, 2013, 3:04:10 AM5/17/13
to Querydsl on behalf of nyc2
Hi.

Please consider upgrading to check if Querydsl 3.1.1 still has the problem.

Lots of things have happened since the 2.6.0 release.

I will take a look.

Timo

nyc2



--
You received this message because you are subscribed to the Google Groups "Querydsl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to querydsl+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Timo Westkämper
Mysema Oy
+358 (0)40 591 2172
www.mysema.com


nyc2

unread,
May 17, 2013, 3:32:52 AM5/17/13
to quer...@googlegroups.com

I'll give Querydsl 3.1.1 a try. However, it seems that there are big API changes (e.g. Object[] vs. Tuple) which could break my system...


On Friday, May 17, 2013 9:04:10 AM UTC+2, Timo Westkämper wrote:
Hi.

Please consider upgrading to check if Querydsl 3.1.1 still has the problem.

Lots of things have happened since the 2.6.0 release.

I will take a look.

Timo

Timo Westkämper

unread,
May 17, 2013, 3:36:19 AM5/17/13
to Querydsl on behalf of nyc2
Hi.

2.9.0 could then be worth a try.

Timo

nyc2

unread,
May 17, 2013, 4:00:55 AM5/17/13
to quer...@googlegroups.com
Tried 2.9.0 and encountered same behavior as in 2.6.0.


On Friday, May 17, 2013 9:36:19 AM UTC+2, Timo Westkämper wrote:
Hi.

2.9.0 could then be worth a try.

Timo

Timo Westkämper

unread,
May 17, 2013, 4:09:48 AM5/17/13
to Querydsl on behalf of nyc2
Hi.

Ok, then please file a bug.

Br,
Timo

nyc2

unread,
May 17, 2013, 4:18:08 AM5/17/13
to quer...@googlegroups.com
https://github.com/mysema/querydsl/issues/419


On Friday, May 17, 2013 10:09:48 AM UTC+2, Timo Westkämper wrote:
Hi.

Ok, then please file a bug.

Br,
Timo

nyc2

unread,
May 17, 2013, 5:13:23 AM5/17/13
to quer...@googlegroups.com
Workaround: Switching EnumPath to NumberPath in QType and use method as described in https://groups.google.com/forum/#!searchin/querydsl/enum$20/querydsl/UFYR3YZdFSg/BQWcaL_CFeQJ
Reply all
Reply to author
Forward
0 new messages