mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-12 21:20:19 +08:00
This commit is contained in:
parent
4adad8aae9
commit
3592b658b0
@ -89,8 +89,7 @@ class AliasTest {
|
||||
|
||||
@Test
|
||||
def Number_Comparison {
|
||||
val predicate: Predicate = person.scalaInt lt 5;
|
||||
assertEquals("person.scalaInt < 5", predicate);
|
||||
assertEquals("person.scalaInt < 5", person.scalaInt lt 5);
|
||||
assertEquals("person.javaInt < 5", person.javaInt lt 5);
|
||||
assertEquals("person.javaInt > 5", person.javaInt gt 5);
|
||||
assertEquals("person.javaInt <= 5", person.javaInt loe 5);
|
||||
|
||||
@ -8,9 +8,17 @@ class ImplicitsTest {
|
||||
|
||||
implicit def toStringWrapper(str: String) = new StringWrapper(str);
|
||||
|
||||
implicit def toIntWrapper(num: Integer) = new IntegerWrapper(num);
|
||||
|
||||
@Test
|
||||
def test(){
|
||||
val res1: Predicate = "str" startsWith "other";
|
||||
def stringValue(){
|
||||
val res: Predicate = "str" startsWith "other";
|
||||
}
|
||||
|
||||
@Test
|
||||
def intValue(){
|
||||
val num: Integer = 1;
|
||||
val res: Predicate = num < 3;
|
||||
}
|
||||
|
||||
}
|
||||
@ -21,4 +29,9 @@ class StringWrapper(str: String){
|
||||
|
||||
}
|
||||
|
||||
class IntegerWrapper(num: Integer){
|
||||
|
||||
def <(other: Integer): Predicate = null;
|
||||
}
|
||||
|
||||
trait Predicate
|
||||
Loading…
Reference in New Issue
Block a user