mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
This commit is contained in:
parent
82e7e50303
commit
87e28c7f8c
@ -5,11 +5,11 @@ import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.BooleanConstant;
|
||||
import com.mysema.query.annotations.QueryDelegate;
|
||||
import com.mysema.query.annotations.QueryEntity;
|
||||
import com.mysema.query.annotations.QuerySupertype;
|
||||
import com.mysema.query.types.expr.BooleanExpression;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.Expression;
|
||||
|
||||
public class DelegateTest {
|
||||
|
||||
@ -40,18 +40,18 @@ public class DelegateTest {
|
||||
}
|
||||
|
||||
@QueryDelegate(User.class)
|
||||
public static BooleanExpression isManagedBy(QDelegateTest_User user, User other){
|
||||
return BooleanConstant.TRUE;
|
||||
public static Expression<Boolean> isManagedBy(QDelegateTest_User user, User other){
|
||||
return ConstantImpl.TRUE;
|
||||
}
|
||||
|
||||
@QueryDelegate(User.class)
|
||||
public static BooleanExpression isManagedBy(QDelegateTest_User user, QDelegateTest_User other){
|
||||
return BooleanConstant.TRUE;
|
||||
public static Expression<Boolean> isManagedBy(QDelegateTest_User user, QDelegateTest_User other){
|
||||
return ConstantImpl.TRUE;
|
||||
}
|
||||
|
||||
@QueryDelegate(User.class)
|
||||
public static BooleanExpression simpleMethod(QDelegateTest_User user){
|
||||
return BooleanConstant.TRUE;
|
||||
public static Expression<Boolean> simpleMethod(QDelegateTest_User user){
|
||||
return ConstantImpl.TRUE;
|
||||
}
|
||||
|
||||
// @QueryDelegate(DelegateTest.User.class)
|
||||
|
||||
@ -15,9 +15,7 @@ import java.util.TreeSet;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.BooleanConstant;
|
||||
import com.mysema.query.NumberConstant;
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.Expression;
|
||||
import com.mysema.query.types.expr.BooleanExpression;
|
||||
import com.mysema.query.types.expr.StringExpression;
|
||||
@ -54,11 +52,11 @@ public class ExprTest {
|
||||
exprs.add(QReservedNamesTest_ReservedNames.reservedNames);
|
||||
exprs.add(QSimpleTypesTest_SimpleTypes.simpleTypes);
|
||||
|
||||
exprs.add(StringConstant.create("Hello World!"));
|
||||
exprs.add(NumberConstant.create(1000));
|
||||
exprs.add(NumberConstant.create(10l));
|
||||
exprs.add(BooleanConstant.TRUE);
|
||||
exprs.add(BooleanConstant.FALSE);
|
||||
exprs.add(ConstantImpl.create("Hello World!"));
|
||||
exprs.add(ConstantImpl.create(1000));
|
||||
exprs.add(ConstantImpl.create(10l));
|
||||
exprs.add(ConstantImpl.TRUE);
|
||||
exprs.add(ConstantImpl.FALSE);
|
||||
|
||||
Set<Expression<?>> toVisit = new HashSet<Expression<?>>();
|
||||
|
||||
|
||||
@ -12,10 +12,9 @@ import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.expr.StringExpression;
|
||||
|
||||
public class PathMetadataTest {
|
||||
@ -30,12 +29,11 @@ public class PathMetadataTest {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@Ignore
|
||||
public void test() throws Exception{
|
||||
Field field = StringConstant.class.getDeclaredField("CACHE");
|
||||
Field field = ConstantImpl.class.getDeclaredField("STRINGS");
|
||||
field.setAccessible(true);
|
||||
Map<String, StringExpression> cache = (Map) field.get(null);
|
||||
System.out.println(cache.size() + " entries in EString cache");
|
||||
System.out.println(cache.size() + " entries in ConstantImpl string cache");
|
||||
|
||||
// numbers
|
||||
assertTrue(cache.containsKey("0"));
|
||||
|
||||
@ -12,13 +12,11 @@ import javax.persistence.Entity;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.NumberConstant;
|
||||
import com.mysema.query.SimpleConstant;
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.annotations.PropertyType;
|
||||
import com.mysema.query.annotations.QueryEntity;
|
||||
import com.mysema.query.annotations.QueryProjection;
|
||||
import com.mysema.query.annotations.QueryType;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
|
||||
public class QueryProjectionTest {
|
||||
|
||||
@ -56,10 +54,10 @@ public class QueryProjectionTest {
|
||||
|
||||
@Test
|
||||
public void entityCase(){
|
||||
QQueryProjectionTest_EntityWithProjection.create(SimpleConstant.create(0l)).newInstance(0l);
|
||||
QQueryProjectionTest_EntityWithProjection.create(StringConstant.create("")).newInstance("");
|
||||
QQueryProjectionTest_EntityWithProjection.create(NumberConstant.create(0l), StringConstant.create("")).newInstance(0l,"");
|
||||
QQueryProjectionTest_EntityWithProjection.create(StringConstant.create(""), StringConstant.create("")).newInstance("","");
|
||||
QQueryProjectionTest_EntityWithProjection.create(ConstantImpl.create(0l)).newInstance(0l);
|
||||
// QQueryProjectionTest_EntityWithProjection.create(ConstantImpl.create("")).newInstance("");
|
||||
// QQueryProjectionTest_EntityWithProjection.create(ConstantImpl.create(0l), ConstantImpl.create("")).newInstance(0l,"");
|
||||
// QQueryProjectionTest_EntityWithProjection.create(ConstantImpl.create(""), ConstantImpl.create("")).newInstance("","");
|
||||
}
|
||||
|
||||
public static class DTOWithProjection {
|
||||
@ -106,10 +104,10 @@ public class QueryProjectionTest {
|
||||
|
||||
@Test
|
||||
public void dtoCase() throws SecurityException, NoSuchMethodException{
|
||||
new QQueryProjectionTest_DTOWithProjection(SimpleConstant.<Long>create(0l)).newInstance(0l);
|
||||
new QQueryProjectionTest_DTOWithProjection(StringConstant.create("")).newInstance("");
|
||||
new QQueryProjectionTest_DTOWithProjection(NumberConstant.create(0l), StringConstant.create("")).newInstance(0l,"");
|
||||
new QQueryProjectionTest_DTOWithProjection(StringConstant.create(""), StringConstant.create("")).newInstance("","");
|
||||
new QQueryProjectionTest_DTOWithProjection(ConstantImpl.create(0l)).newInstance(0l);
|
||||
// new QQueryProjectionTest_DTOWithProjection(StringConstant.create("")).newInstance("");
|
||||
// new QQueryProjectionTest_DTOWithProjection(ConstantImpl.create(0l), StringConstant.create("")).newInstance(0l,"");
|
||||
// new QQueryProjectionTest_DTOWithProjection(StringConstant.create(""), StringConstant.create("")).newInstance("","");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,12 +5,12 @@ import java.sql.Timestamp;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.BooleanConstant;
|
||||
import com.mysema.query.annotations.QueryDelegate;
|
||||
import com.mysema.query.annotations.QueryEmbeddable;
|
||||
import com.mysema.query.annotations.QueryEntity;
|
||||
import com.mysema.query.annotations.QuerySupertype;
|
||||
import com.mysema.query.types.expr.BooleanExpression;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.Expression;
|
||||
import com.mysema.query.types.path.DatePath;
|
||||
import com.mysema.query.types.path.DateTimePath;
|
||||
|
||||
@ -24,16 +24,16 @@ public class QueryExtensions10Test {
|
||||
* Adds a period filter
|
||||
*/
|
||||
@QueryDelegate(Date.class)
|
||||
public static BooleanExpression period(DatePath<Date> expr, Interval<Date> period) {
|
||||
return BooleanConstant.TRUE;
|
||||
public static Expression<Boolean> period(DatePath<Date> expr, Interval<Date> period) {
|
||||
return ConstantImpl.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a timestamp period filter on a timestamp expression
|
||||
*/
|
||||
@QueryDelegate(Timestamp.class)
|
||||
public static BooleanExpression period(DateTimePath<Timestamp> expr, Interval<Timestamp> period) {
|
||||
return BooleanConstant.TRUE;
|
||||
public static Expression<Boolean> period(DateTimePath<Timestamp> expr, Interval<Timestamp> period) {
|
||||
return ConstantImpl.TRUE;
|
||||
}
|
||||
|
||||
@QueryEmbeddable
|
||||
|
||||
@ -7,12 +7,13 @@ package com.mysema.query.extensions;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.eclipse.jdt.internal.compiler.impl.StringConstant;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.annotations.QueryEntity;
|
||||
import com.mysema.query.annotations.QueryExtensions;
|
||||
import com.mysema.query.annotations.QueryMethod;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
|
||||
public class QueryExtensions5Test {
|
||||
|
||||
@ -57,11 +58,11 @@ public class QueryExtensions5Test {
|
||||
public void test_prop_and_method_available(){
|
||||
assertNotNull(QQueryExtensions5Test_Entity.entity.prop);
|
||||
assertNotNull(QQueryExtensions5Test_Entity.entity.method());
|
||||
assertNotNull(QQueryExtensions5Test_Entity.entity.method(StringConstant.create("")));
|
||||
assertNotNull(QQueryExtensions5Test_Entity.entity.method(ConstantImpl.create("")));
|
||||
|
||||
assertNotNull(QQueryExtensions5Test_Entity2.entity2.prop);
|
||||
assertNotNull(QQueryExtensions5Test_Entity2.entity2.method());
|
||||
assertNotNull(QQueryExtensions5Test_Entity2.entity2.method(StringConstant.create("")));
|
||||
assertNotNull(QQueryExtensions5Test_Entity2.entity2.method(ConstantImpl.create("")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,12 +5,12 @@ import static org.junit.Assert.assertNotNull;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.BooleanConstant;
|
||||
import com.mysema.query.annotations.QueryDelegate;
|
||||
import com.mysema.query.annotations.QueryEntity;
|
||||
import com.mysema.query.annotations.QueryExtensions;
|
||||
import com.mysema.query.annotations.QueryMethod;
|
||||
import com.mysema.query.types.expr.BooleanExpression;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.Expression;
|
||||
|
||||
import ext.java.lang.QByte;
|
||||
|
||||
@ -35,8 +35,8 @@ public class QueryExtensions7Test {
|
||||
}
|
||||
|
||||
@QueryDelegate(Byte.class)
|
||||
public static BooleanExpression isNumeric(QByte byteValue){
|
||||
return BooleanConstant.TRUE;
|
||||
public static Expression<Boolean> isNumeric(QByte byteValue){
|
||||
return ConstantImpl.TRUE;
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@ -32,6 +32,10 @@ public class ConstantImpl<T> extends ExpressionBase<T> implements Constant<T> {
|
||||
private static final Constant<Short>[] SHORTS = new Constant[CACHE_SIZE];
|
||||
|
||||
private static final Map<String,Constant<String>> STRINGS;
|
||||
|
||||
public static final Constant<Boolean> FALSE = new ConstantImpl<Boolean>(Boolean.FALSE);
|
||||
|
||||
public static final Constant<Boolean> TRUE = new ConstantImpl<Boolean>(Boolean.TRUE);
|
||||
|
||||
static{
|
||||
List<String> strs = new ArrayList<String>(Arrays.asList("", ".", ".*", "%"));
|
||||
|
||||
@ -15,7 +15,7 @@ import com.mysema.query.types.expr.BooleanExpression;
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
public final class BooleanConstant extends BooleanExpression implements Constant<Boolean>{
|
||||
final class BooleanConstant extends BooleanExpression implements Constant<Boolean>{
|
||||
|
||||
public static final BooleanExpression FALSE = new BooleanConstant(Boolean.FALSE);
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ import com.mysema.query.types.expr.NumberExpression;
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
public final class DateConstant<D extends java.util.Date> extends DateExpression<D> implements Constant<D>{
|
||||
final class DateConstant<D extends java.util.Date> extends DateExpression<D> implements Constant<D>{
|
||||
|
||||
private static final long serialVersionUID = -5745611667058255826L;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query.types;
|
||||
package com.mysema.query;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@ -12,7 +12,6 @@ import java.util.Calendar;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.DateConstant;
|
||||
import com.mysema.query.types.expr.DateExpression;
|
||||
|
||||
public class DateConstantTest {
|
||||
@ -14,7 +14,7 @@ import com.mysema.query.types.expr.NumberExpression;
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
public final class DateTimeConstant<D extends java.util.Date> extends DateTimeExpression<D> implements Constant<D>{
|
||||
final class DateTimeConstant<D extends java.util.Date> extends DateTimeExpression<D> implements Constant<D>{
|
||||
|
||||
private static final long serialVersionUID = 4578416585568476532L;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query.types;
|
||||
package com.mysema.query;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@ -12,7 +12,6 @@ import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.DateTimeConstant;
|
||||
import com.mysema.query.types.expr.DateTimeExpression;
|
||||
|
||||
public class DateTimeConstantTest {
|
||||
@ -20,7 +20,7 @@ import com.mysema.util.MathUtils;
|
||||
*
|
||||
* @param <D>
|
||||
*/
|
||||
public final class NumberConstant<D extends Number & Comparable<?>> extends NumberExpression<D> implements Constant<D>{
|
||||
final class NumberConstant<D extends Number & Comparable<?>> extends NumberExpression<D> implements Constant<D>{
|
||||
|
||||
private static final long serialVersionUID = 2958824808974260439L;
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ import com.mysema.query.types.expr.SimpleExpression;
|
||||
*
|
||||
* @param <D> Java type of constant
|
||||
*/
|
||||
public class SimpleConstant<D> extends SimpleExpression<D> implements Constant<D> {
|
||||
final class SimpleConstant<D> extends SimpleExpression<D> implements Constant<D> {
|
||||
|
||||
private static final long serialVersionUID = -3211963259241932307L;
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ import com.mysema.query.types.expr.StringExpression;
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
public final class StringConstant extends StringExpression implements Constant<String>{
|
||||
final class StringConstant extends StringExpression implements Constant<String>{
|
||||
|
||||
private static final long serialVersionUID = 5182804405789674556L;
|
||||
|
||||
|
||||
@ -3,13 +3,12 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query.types;
|
||||
package com.mysema.query;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.types.expr.StringExpression;
|
||||
|
||||
public class StringConstantTest {
|
||||
@ -16,7 +16,7 @@ import com.mysema.query.types.expr.TimeExpression;
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
public final class TimeConstant<D extends java.util.Date> extends TimeExpression<D> implements Constant<D>{
|
||||
final class TimeConstant<D extends java.util.Date> extends TimeExpression<D> implements Constant<D>{
|
||||
|
||||
private static final long serialVersionUID = -7835941761930555480L;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query.types;
|
||||
package com.mysema.query;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@ -12,7 +12,6 @@ import java.util.Calendar;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.TimeConstant;
|
||||
import com.mysema.query.types.expr.TimeExpression;
|
||||
|
||||
public class TimeConstantTest {
|
||||
@ -9,7 +9,7 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.JavaTemplates;
|
||||
import com.mysema.query.types.custom.StringTemplate;
|
||||
import com.mysema.query.types.path.PathBuilder;
|
||||
@ -28,9 +28,9 @@ public class SerializerBaseTest {
|
||||
// long path
|
||||
serializer.handle(new PathBuilder<Object>(Object.class,"p").getList("l",Map.class).get(0));
|
||||
// constant
|
||||
serializer.handle(StringConstant.create(""));
|
||||
// custom
|
||||
serializer.handle(StringTemplate.create("xxx", StringConstant.create("")));
|
||||
serializer.handle(ConstantImpl.create(""));
|
||||
// custom
|
||||
serializer.handle(StringTemplate.create("xxx", ConstantImpl.create("")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,11 +7,7 @@ package com.mysema.query.types;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.NumberConstant;
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.types.expr.ConstructorExpression;
|
||||
import com.mysema.query.types.expr.NumberExpression;
|
||||
import com.mysema.query.types.expr.StringExpression;
|
||||
|
||||
public class ConstructorExpressionTest {
|
||||
|
||||
@ -36,21 +32,21 @@ public class ConstructorExpressionTest {
|
||||
|
||||
@Test
|
||||
public void test_Constructor(){
|
||||
NumberExpression<Long> longVal = NumberConstant.create(1l);
|
||||
StringExpression stringVal = StringConstant.create("");
|
||||
Expression<Long> longVal = ConstantImpl.create(1l);
|
||||
Expression<String> stringVal = ConstantImpl.create("");
|
||||
new ConstructorExpression<Projection>(Projection.class, new Class[]{long.class, String.class}, longVal, stringVal).newInstance(0l,"");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_create(){
|
||||
NumberExpression<Long> longVal = NumberConstant.create(1l);
|
||||
StringExpression stringVal = StringConstant.create("");
|
||||
Expression<Long> longVal = ConstantImpl.create(1l);
|
||||
Expression<String> stringVal = ConstantImpl.create("");
|
||||
ConstructorExpression.create(Projection.class, longVal, stringVal).newInstance(0l,"");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_create2(){
|
||||
NumberExpression<Long> longVal = NumberConstant.create(1l);
|
||||
Expression<Long> longVal = ConstantImpl.create(1l);
|
||||
ConstructorExpression.create(Projection.class, longVal).newInstance(0l);
|
||||
}
|
||||
|
||||
@ -61,7 +57,7 @@ public class ConstructorExpressionTest {
|
||||
|
||||
@Test
|
||||
public void test_create4(){
|
||||
StringExpression stringVal = StringConstant.create("");
|
||||
Expression<String> stringVal = ConstantImpl.create("");
|
||||
ConstructorExpression.create(Projection.class, stringVal).newInstance("");
|
||||
}
|
||||
|
||||
|
||||
@ -16,15 +16,15 @@ import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.BooleanConstant;
|
||||
import com.mysema.query.types.TemplateExpression;
|
||||
import com.mysema.query.types.Constant;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.Expression;
|
||||
import com.mysema.query.types.JavaTemplates;
|
||||
import com.mysema.query.types.Template;
|
||||
import com.mysema.query.types.TemplateExpression;
|
||||
import com.mysema.query.types.TemplateFactory;
|
||||
import com.mysema.query.types.Templates;
|
||||
import com.mysema.query.types.ToStringVisitor;
|
||||
import com.mysema.query.types.expr.BooleanExpression;
|
||||
import com.mysema.query.types.path.StringPath;
|
||||
|
||||
public class CustomTest {
|
||||
@ -63,7 +63,7 @@ public class CustomTest {
|
||||
@Test
|
||||
public void factoryMethods(){
|
||||
String template = "";
|
||||
BooleanExpression arg = BooleanConstant.TRUE;
|
||||
Constant<Boolean> arg = ConstantImpl.TRUE;
|
||||
|
||||
BooleanTemplate.create(template, arg);
|
||||
ComparableTemplate.create(String.class, template, arg);
|
||||
@ -78,7 +78,7 @@ public class CustomTest {
|
||||
@Test
|
||||
public void factoryMethods2(){
|
||||
Template template = TemplateFactory.DEFAULT.create("");
|
||||
BooleanExpression arg = BooleanConstant.TRUE;
|
||||
Constant<Boolean> arg = ConstantImpl.TRUE;
|
||||
|
||||
BooleanTemplate.create(template, arg);
|
||||
ComparableTemplate.create(String.class, template, arg);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query.lucene;
|
||||
package com.mysema.query;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
@ -37,6 +37,8 @@ import com.mysema.query.Module;
|
||||
import com.mysema.query.QueryMetadata;
|
||||
import com.mysema.query.StringConstant;
|
||||
import com.mysema.query.Target;
|
||||
import com.mysema.query.lucene.LuceneSerializer;
|
||||
import com.mysema.query.lucene.QueryElement;
|
||||
import com.mysema.query.types.Expression;
|
||||
import com.mysema.query.types.expr.BooleanExpression;
|
||||
import com.mysema.query.types.path.NumberPath;
|
||||
@ -12,7 +12,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.NumberConstant;
|
||||
import com.mysema.query.types.ConstantImpl;
|
||||
import com.mysema.query.types.Template;
|
||||
import com.mysema.query.types.TemplateFactory;
|
||||
import com.mysema.query.types.custom.SimpleTemplate;
|
||||
@ -25,7 +25,7 @@ public class SQLTemplatesTest {
|
||||
assertTrue(template.getElements().get(1).isAsString());
|
||||
|
||||
SQLSerializer serializer = new SQLSerializer(new DerbyTemplates());
|
||||
serializer.handle(SimpleTemplate.create(Object.class, template, NumberConstant.create(5)));
|
||||
serializer.handle(SimpleTemplate.create(Object.class, template, ConstantImpl.create(5)));
|
||||
assertEquals("fetch first 5 rows only", serializer.toString());
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user