Scala implicit conversion for Java enums is missing

Bug #820948 reported by Tobias Roeser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

When using QueryDSL 2.2.0 with Scala, Creating queries with expressions on Java enums givens compile errors.

Code example:

override def findByPaymentStatus(paymentStatus: PaymentStatus): JuList[Payment] =
    query.from(payment).where(payment.paymentStatus $eq paymentStatus).list(payment)

Error is (copied from Eclispse IDE):

overloaded method value = with alternatives: (right: com.mysema.query.types.Expression[_$9])
 com.mysema.query.scala.escaped.BooleanExpression <and> (right: _$9)com.mysema.query.scala.escaped.BooleanExpression
 cannot be applied to (de.tototec.tupomoja.request.model.PaymentStatus)

When adding the following implicit conversion in scope, the code compiles fine:

import com.mysema.query.scala.Conversions
implicit def enumPath[E <: Enum[E]](e: E): com.mysema.query.scala.escaped.EnumPath[E] =
    Conversions.aliasFactory.getCurrentAndReset()

I think, this implicit conversion should be added to com.mysema.query.scala.Conversions object.

Tags: scala
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Thanks for the bug report. Fixed in SVN trunk.

Changed in querydsl:
status: New → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.2.1

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.