mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
This commit is contained in:
parent
f6a1479f58
commit
2882621346
@ -103,6 +103,10 @@ trait ListExpression[T, Q <: Expression[_ >: T]] extends CollectionExpressionBas
|
||||
def get(i: Int): Q;
|
||||
|
||||
def get(i: Expression[Integer]): Q;
|
||||
|
||||
def apply(i: Int) = get(i);
|
||||
|
||||
def apply(i: Expression[Integer]) = get(i);
|
||||
|
||||
}
|
||||
|
||||
@ -126,6 +130,9 @@ trait MapExpression[K, V, Q <: Expression[_ >: V]] extends SimpleExpression[java
|
||||
|
||||
def get(key: Expression[K]): Q;
|
||||
|
||||
def apply(key: K) = get(key);
|
||||
|
||||
def apply(key: Expression[K]) = get(key);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -175,11 +175,21 @@ class ExpressionTest {
|
||||
assertEquals("person.javaList.get(0) is not null", person.javaList.get(0) isNotNull);
|
||||
assertEquals("person.javaMap.get(xxx) is null", person.javaMap.get("xxx") isNull);
|
||||
}
|
||||
|
||||
@Test
|
||||
def Java_Collection_Get_With_Apply {
|
||||
assertEquals("person.javaList.get(0) is not null", person.javaList(0) isNotNull);
|
||||
}
|
||||
|
||||
@Test
|
||||
def Java_Collections_Get_And_Starts_With {
|
||||
assertEquals("startsWith(person.javaMap.get(xxx),X)", person.javaMap.get("xxx") startsWith "X");
|
||||
}
|
||||
|
||||
@Test
|
||||
def Java_Collections_Get_With_Apply {
|
||||
assertEquals("startsWith(person.javaMap.get(xxx),X)", person.javaMap("xxx") startsWith "X");
|
||||
}
|
||||
|
||||
@Test
|
||||
def Scala_Collections_Size {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user