mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
#68 improved support for primitive types
This commit is contained in:
parent
222b7ec07f
commit
f5536948ea
@ -33,17 +33,20 @@ package object scala {
|
||||
|
||||
object Numeric {
|
||||
implicit val byte = new Numeric[Byte]
|
||||
implicit val byte2 = new Numeric[java.lang.Byte]
|
||||
implicit val double = new Numeric[Double]
|
||||
implicit val double2 = new Numeric[java.lang.Double]
|
||||
implicit val float = new Numeric[Float]
|
||||
implicit val float2 = new Numeric[java.lang.Float]
|
||||
implicit val int = new Numeric[Int]
|
||||
implicit val int2 = new Numeric[java.lang.Integer]
|
||||
implicit val long = new Numeric[Long]
|
||||
implicit val short = new Numeric[Short]
|
||||
implicit val byte2 = new Numeric[java.lang.Byte]
|
||||
implicit val double2 = new Numeric[java.lang.Double]
|
||||
implicit val float2 = new Numeric[java.lang.Float]
|
||||
implicit val int2 = new Numeric[java.lang.Integer]
|
||||
implicit val long2 = new Numeric[java.lang.Long]
|
||||
implicit val short2 = new Numeric[java.lang.Short]
|
||||
implicit val short = new Numeric[Short]
|
||||
implicit val short2 = new Numeric[java.lang.Short]
|
||||
|
||||
implicit val bigDecimal = new Numeric[java.math.BigDecimal]
|
||||
implicit val bigInteger = new Numeric[java.math.BigInteger]
|
||||
}
|
||||
|
||||
class Numeric[Num]
|
||||
|
||||
@ -150,7 +150,7 @@ class ExpressionTest {
|
||||
@Test
|
||||
def Number_Comparison {
|
||||
assertEquals("person.scalaInt < 5", person.scalaInt lt 5)
|
||||
assertEquals("person.scalaInt = 5", person.scalaInt eq 5.asInstanceOf[Integer]) // FIXME
|
||||
assertEquals("person.scalaInt = 5", person.scalaInt eq 5)
|
||||
|
||||
assertEquals("person.javaInt < 5", person.javaInt lt 5)
|
||||
assertEquals("person.javaInt > 5", person.javaInt gt 5)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user