mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
commit
5656d02fe7
@ -25,7 +25,7 @@
|
||||
<properties>
|
||||
<hibernate.version>4.3.7.Final</hibernate.version>
|
||||
<hibernate.validator.version>4.3.1.Final</hibernate.validator.version>
|
||||
<eclipselink.version>2.5.1</eclipselink.version>
|
||||
<eclipselink.version>2.6.0-RC1</eclipselink.version>
|
||||
<osgi.import.package>javax.persistence.*;version="[1.1,3)",${osgi.import.package.root}</osgi.import.package>
|
||||
</properties>
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ public class EclipseLinkTemplates extends JPQLTemplates {
|
||||
|
||||
add(Ops.CHAR_AT, "substring({0},{1}+1,1)");
|
||||
add(JPQLOps.CAST, "cast({0} {1s})");
|
||||
add(Ops.STRING_CAST, "cast({0} varchar(255))");
|
||||
add(Ops.STRING_CAST, "trim(cast({0} char(128)))");
|
||||
add(Ops.NUMCAST, "cast({0} {1s})");
|
||||
|
||||
// datetime
|
||||
|
||||
@ -343,6 +343,24 @@ public abstract class AbstractJPATest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Cast_ToString() {
|
||||
for (Tuple tuple : query().from(cat).list(cat.breed, cat.breed.stringValue())) {
|
||||
assertEquals(
|
||||
tuple.get(cat.breed).toString(),
|
||||
tuple.get(cat.breed.stringValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Cast_ToString_Append() {
|
||||
for (Tuple tuple : query().from(cat).list(cat.breed, cat.breed.stringValue().append("test"))) {
|
||||
assertEquals(
|
||||
tuple.get(cat.breed).toString() + "test",
|
||||
tuple.get(cat.breed.stringValue().append("test")));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Collection_Predicates() {
|
||||
ListPath<Cat, QCat> path = cat.kittens;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user