mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-21 21:14:12 +08:00
#60 : removed wrapping
This commit is contained in:
parent
7dda0ad5fc
commit
54c7cb32f0
@ -1,7 +1,7 @@
|
||||
----------------------------------------------------------------
|
||||
Sun Nov 27 21:26:21 EET 2011:
|
||||
Booting Derby version The Apache Software Foundation - Apache Derby - 10.8.2.2 - (1181258): instance a816c00e-0133-e67e-0d11-000002922e68
|
||||
on database directory /home/tiwe/work/querydsl/querydsl-jpa/target/derbydb2 with class loader sun.misc.Launcher$AppClassLoader@1a16869
|
||||
Wed Nov 30 22:02:31 EET 2011:
|
||||
Booting Derby version The Apache Software Foundation - Apache Derby - 10.8.2.2 - (1181258): instance a816c00e-0133-f612-4257-000002fc4ca8
|
||||
on database directory /home/tiwe/work/querydsl/querydsl-jpa/target/derbydb with class loader sun.misc.Launcher$AppClassLoader@1a16869
|
||||
Loaded from file:/home/tiwe/.m2/repository/org/apache/derby/derby/10.8.2.2/derby-10.8.2.2.jar
|
||||
java.vendor=Sun Microsystems Inc.
|
||||
java.runtime.version=1.6.0_26-b03
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
package com.mysema.query.jpa;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.mysema.query.types.Constant;
|
||||
import com.mysema.query.types.Operator;
|
||||
import com.mysema.query.types.Ops;
|
||||
import com.mysema.query.types.PathType;
|
||||
@ -15,7 +13,7 @@ import com.mysema.query.types.PathType;
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
public class HQLTemplates extends JPQLTemplates{
|
||||
public class HQLTemplates extends JPQLTemplates {
|
||||
|
||||
private static final List<Operator<?>> wrapElements = Arrays.<Operator<?>> asList(
|
||||
Ops.QuantOps.ALL,
|
||||
@ -61,12 +59,6 @@ public class HQLTemplates extends JPQLTemplates{
|
||||
return wrapElements.contains(operator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrapConstant(Constant<?> expr) {
|
||||
Class<?> type = expr.getType();
|
||||
return type.isArray() || Collection.class.isAssignableFrom(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTypeAsString() {
|
||||
return true;
|
||||
|
||||
@ -224,10 +224,6 @@ public class JPQLSerializer extends SerializerBase<JPQLSerializer> {
|
||||
|
||||
@Override
|
||||
public Void visit(Constant<?> expr, Void context) {
|
||||
boolean wrap = templates.wrapConstant(expr);
|
||||
if (wrap) {
|
||||
append("(");
|
||||
}
|
||||
append(":");
|
||||
if (!getConstantToLabel().containsKey(expr.getConstant())) {
|
||||
String constLabel = getConstantPrefix() + (getConstantToLabel().size()+1);
|
||||
@ -236,9 +232,6 @@ public class JPQLSerializer extends SerializerBase<JPQLSerializer> {
|
||||
} else {
|
||||
append(getConstantToLabel().get(expr.getConstant()));
|
||||
}
|
||||
if (wrap) {
|
||||
append(")");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -107,10 +107,6 @@ public class JPQLTemplates extends Templates {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean wrapConstant(Constant<?> expr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isTypeAsString() {
|
||||
// TODO : get rid of this when Hibernate supports type(alias)
|
||||
return false;
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user