use of com.querydsl.core.types.dsl.StringExpression in project querydsl by querydsl.
the class GroupByMapTest method compile.
@Test
public void compile() {
StringExpression str = Expressions.stringPath("str");
GroupExpression<String, String> strGroup = new GOne<String>(str);
GroupBy.sortedMap(strGroup, str, null);
GroupBy.sortedMap(str, strGroup, null);
}
use of com.querydsl.core.types.dsl.StringExpression in project querydsl by querydsl.
the class PathMetadataTest method test.
@SuppressWarnings("unchecked")
@Test
public void test() throws Exception {
Field field = ConstantImpl.class.getDeclaredField("STRINGS");
field.setAccessible(true);
Map<String, StringExpression> cache = (Map) field.get(null);
System.out.println(cache.size() + " entries in ConstantImpl string cache");
// numbers
assertTrue(cache.containsKey("0"));
assertTrue(cache.containsKey("10"));
// variables
assertTrue(cache.containsKey("animal"));
assertTrue(cache.containsKey("cat"));
assertTrue(cache.containsKey("category"));
assertTrue(cache.containsKey("simpleTypes"));
// properties
assertTrue(cache.containsKey("mate"));
}
use of com.querydsl.core.types.dsl.StringExpression in project querydsl by querydsl.
the class QueryProjectionTest method dto_case.
@Test
public void dto_case() throws SecurityException, NoSuchMethodException {
NumberExpression<Long> longExpr = Expressions.numberPath(Long.class, "x");
StringExpression stringExpr = Expressions.stringPath("x");
new QQueryProjectionTest_DTOWithProjection(longExpr).newInstance(0L);
new QQueryProjectionTest_DTOWithProjection(stringExpr).newInstance("");
new QQueryProjectionTest_DTOWithProjection(longExpr, stringExpr).newInstance(0L, "");
new QQueryProjectionTest_DTOWithProjection(stringExpr, stringExpr).newInstance("", "");
}
use of com.querydsl.core.types.dsl.StringExpression in project querydsl by querydsl.
the class QueryProjectionTest method entity_case.
@Test
public void entity_case() {
NumberExpression<Long> longExpr = Expressions.numberPath(Long.class, "x");
StringExpression stringExpr = Expressions.stringPath("x");
QQueryProjectionTest_EntityWithProjection.create(longExpr).newInstance(0L);
QQueryProjectionTest_EntityWithProjection.create(stringExpr).newInstance("");
QQueryProjectionTest_EntityWithProjection.create(longExpr, stringExpr).newInstance(0L, "");
QQueryProjectionTest_EntityWithProjection.create(stringExpr, stringExpr).newInstance("", "");
}
use of com.querydsl.core.types.dsl.StringExpression in project querydsl by querydsl.
the class TemplateTest method toDate.
@Test
public void toDate() {
StringExpression str = Expressions.stringPath("str");
assertEquals("to_date(str,'DD-MON-YYYY')", to_date(str, "DD-MON-YYYY").toString());
}
Aggregations