Scala implicit conversion for Java enums is missing

Bug #820948 reported by Tobias Roeser on 2011-08-04
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.

Thanks for the bug report. Fixed in SVN trunk.

Changed in querydsl:
status: New → Fix Committed

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  Edit
Everyone can see this information.

Other bug subscribers