mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
This commit is contained in:
parent
832f272883
commit
4adad8aae9
@ -314,7 +314,7 @@ trait NumberExpression[T <: Number with Comparable[T]] extends ComparableExpress
|
||||
|
||||
}
|
||||
|
||||
trait BooleanFunctions {
|
||||
abstract trait BooleanFunctions {
|
||||
|
||||
def and(right: Predicate): BooleanExpression;
|
||||
|
||||
|
||||
@ -101,8 +101,7 @@ class AliasTest {
|
||||
|
||||
@Test
|
||||
def Number_Comparison2 {
|
||||
val predicate: Predicate = person.scalaInt < 5;
|
||||
assertEquals("person.scalaInt < 5", predicate);
|
||||
assertEquals("person.scalaInt < 5", person.scalaInt < 5);
|
||||
assertEquals("person.javaInt < 5", person.javaInt < 5);
|
||||
assertEquals("person.javaInt > 5", person.javaInt > 5);
|
||||
assertEquals("person.javaInt <= 5", person.javaInt <= 5);
|
||||
@ -196,7 +195,7 @@ class AliasTest {
|
||||
|
||||
@Test
|
||||
def Array_Size {
|
||||
val num: NumberExpression[Integer] = person.array size();
|
||||
val num: NumberExpression[Integer] = person.array size;
|
||||
assertEquals("size(person.array)", num);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package com.mysema.testutil
|
||||
|
||||
import org.junit.{ Test, Before, After };
|
||||
import org.junit.Assert._
|
||||
|
||||
|
||||
class ImplicitsTest {
|
||||
|
||||
implicit def toStringWrapper(str: String) = new StringWrapper(str);
|
||||
|
||||
@Test
|
||||
def test(){
|
||||
val res1: Predicate = "str" startsWith "other";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class StringWrapper(str: String){
|
||||
|
||||
def startsWith(other: String): Predicate = null;
|
||||
|
||||
}
|
||||
|
||||
trait Predicate
|
||||
Loading…
Reference in New Issue
Block a user