mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
organized imports
This commit is contained in:
parent
a90490eec6
commit
52102dbb8b
@ -19,22 +19,7 @@ import javax.annotation.Nullable;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.mysema.query.types.Expr;
|
||||
import com.mysema.query.types.path.PArray;
|
||||
import com.mysema.query.types.path.PBoolean;
|
||||
import com.mysema.query.types.path.PCollection;
|
||||
import com.mysema.query.types.path.PComparable;
|
||||
import com.mysema.query.types.path.PDate;
|
||||
import com.mysema.query.types.path.PDateTime;
|
||||
import com.mysema.query.types.path.PEntity;
|
||||
import com.mysema.query.types.path.PList;
|
||||
import com.mysema.query.types.path.PMap;
|
||||
import com.mysema.query.types.path.PNumber;
|
||||
import com.mysema.query.types.path.PSet;
|
||||
import com.mysema.query.types.path.PSimple;
|
||||
import com.mysema.query.types.path.PString;
|
||||
import com.mysema.query.types.path.PTime;
|
||||
import com.mysema.query.types.path.PathBuilder;
|
||||
import com.mysema.query.types.path.PathMetadataFactory;
|
||||
import com.mysema.query.types.path.*;
|
||||
|
||||
/**
|
||||
* Alias provides alias factory methods
|
||||
|
||||
@ -32,20 +32,7 @@ import com.mysema.query.types.Path;
|
||||
import com.mysema.query.types.PathMetadata;
|
||||
import com.mysema.query.types.expr.ECollection;
|
||||
import com.mysema.query.types.expr.EMap;
|
||||
import com.mysema.query.types.path.PArray;
|
||||
import com.mysema.query.types.path.PBoolean;
|
||||
import com.mysema.query.types.path.PCollection;
|
||||
import com.mysema.query.types.path.PComparable;
|
||||
import com.mysema.query.types.path.PDate;
|
||||
import com.mysema.query.types.path.PDateTime;
|
||||
import com.mysema.query.types.path.PEntity;
|
||||
import com.mysema.query.types.path.PList;
|
||||
import com.mysema.query.types.path.PMap;
|
||||
import com.mysema.query.types.path.PNumber;
|
||||
import com.mysema.query.types.path.PSet;
|
||||
import com.mysema.query.types.path.PString;
|
||||
import com.mysema.query.types.path.PTime;
|
||||
import com.mysema.query.types.path.PathMetadataFactory;
|
||||
import com.mysema.query.types.path.*;
|
||||
import com.mysema.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
|
||||
@ -90,8 +90,23 @@ public final class ClassType extends AbstractType{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendLocalGenericName(Type context, Appendable builder, boolean asArgType) throws IOException {
|
||||
public void appendLocalGenericName(Type context, Appendable builder, boolean asArgType) throws IOException {
|
||||
appendLocalRawName(context, builder);
|
||||
if (!parameters.isEmpty()){
|
||||
String fullName = clazz.getName();
|
||||
builder.append("<");
|
||||
for (int i = 0; i < parameters.size(); i++){
|
||||
if (i > 0){
|
||||
builder.append(",");
|
||||
}
|
||||
if (parameters.get(i) != null && !parameters.get(i).getFullName().equals(fullName)){
|
||||
parameters.get(i).appendLocalGenericName(context, builder, false);
|
||||
}else{
|
||||
builder.append("?");
|
||||
}
|
||||
}
|
||||
builder.append(">");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -16,18 +16,7 @@ import com.mysema.query.BooleanBuilder;
|
||||
import com.mysema.query.JoinFlag;
|
||||
import com.mysema.query.QueryFlag;
|
||||
import com.mysema.query.QueryFlag.Position;
|
||||
import com.mysema.query.types.Constant;
|
||||
import com.mysema.query.types.Custom;
|
||||
import com.mysema.query.types.EConstructor;
|
||||
import com.mysema.query.types.Expr;
|
||||
import com.mysema.query.types.Operation;
|
||||
import com.mysema.query.types.Operator;
|
||||
import com.mysema.query.types.Param;
|
||||
import com.mysema.query.types.Path;
|
||||
import com.mysema.query.types.PathType;
|
||||
import com.mysema.query.types.Template;
|
||||
import com.mysema.query.types.Templates;
|
||||
import com.mysema.query.types.Visitor;
|
||||
import com.mysema.query.types.*;
|
||||
|
||||
/**
|
||||
* SerializerBase is a stub for Serializer implementations
|
||||
|
||||
@ -13,16 +13,7 @@ import com.mysema.query.types.expr.EDateTime;
|
||||
import com.mysema.query.types.expr.ENumber;
|
||||
import com.mysema.query.types.expr.EString;
|
||||
import com.mysema.query.types.expr.ETime;
|
||||
import com.mysema.query.types.query.BooleanSubQuery;
|
||||
import com.mysema.query.types.query.ComparableSubQuery;
|
||||
import com.mysema.query.types.query.DateSubQuery;
|
||||
import com.mysema.query.types.query.DateTimeSubQuery;
|
||||
import com.mysema.query.types.query.Detachable;
|
||||
import com.mysema.query.types.query.ListSubQuery;
|
||||
import com.mysema.query.types.query.NumberSubQuery;
|
||||
import com.mysema.query.types.query.ObjectSubQuery;
|
||||
import com.mysema.query.types.query.StringSubQuery;
|
||||
import com.mysema.query.types.query.TimeSubQuery;
|
||||
import com.mysema.query.types.query.*;
|
||||
|
||||
/**
|
||||
* DetachableAdapter is an apadater implementation for the Detachable interface
|
||||
|
||||
@ -16,16 +16,7 @@ import com.mysema.query.types.expr.ENumber;
|
||||
import com.mysema.query.types.expr.EString;
|
||||
import com.mysema.query.types.expr.ETime;
|
||||
import com.mysema.query.types.expr.ONumber;
|
||||
import com.mysema.query.types.query.BooleanSubQuery;
|
||||
import com.mysema.query.types.query.ComparableSubQuery;
|
||||
import com.mysema.query.types.query.DateSubQuery;
|
||||
import com.mysema.query.types.query.DateTimeSubQuery;
|
||||
import com.mysema.query.types.query.Detachable;
|
||||
import com.mysema.query.types.query.ListSubQuery;
|
||||
import com.mysema.query.types.query.NumberSubQuery;
|
||||
import com.mysema.query.types.query.ObjectSubQuery;
|
||||
import com.mysema.query.types.query.StringSubQuery;
|
||||
import com.mysema.query.types.query.TimeSubQuery;
|
||||
import com.mysema.query.types.query.*;
|
||||
|
||||
/**
|
||||
* Mixin style implementation of the Detachable interface
|
||||
|
||||
@ -13,16 +13,7 @@ import com.mysema.query.types.expr.EDateTime;
|
||||
import com.mysema.query.types.expr.ENumber;
|
||||
import com.mysema.query.types.expr.EString;
|
||||
import com.mysema.query.types.expr.ETime;
|
||||
import com.mysema.query.types.query.BooleanSubQuery;
|
||||
import com.mysema.query.types.query.ComparableSubQuery;
|
||||
import com.mysema.query.types.query.DateSubQuery;
|
||||
import com.mysema.query.types.query.DateTimeSubQuery;
|
||||
import com.mysema.query.types.query.Detachable;
|
||||
import com.mysema.query.types.query.ListSubQuery;
|
||||
import com.mysema.query.types.query.NumberSubQuery;
|
||||
import com.mysema.query.types.query.ObjectSubQuery;
|
||||
import com.mysema.query.types.query.StringSubQuery;
|
||||
import com.mysema.query.types.query.TimeSubQuery;
|
||||
import com.mysema.query.types.query.*;
|
||||
|
||||
/**
|
||||
* DetachableQuery is a base class for queries which implement the Query and Detachable interfaces
|
||||
|
||||
@ -9,22 +9,7 @@ import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.mysema.query.types.Expr;
|
||||
import com.mysema.query.types.expr.EArray;
|
||||
import com.mysema.query.types.expr.EBoolean;
|
||||
import com.mysema.query.types.expr.ECollection;
|
||||
import com.mysema.query.types.expr.EComparable;
|
||||
import com.mysema.query.types.expr.EDate;
|
||||
import com.mysema.query.types.expr.EDateConst;
|
||||
import com.mysema.query.types.expr.EDateTime;
|
||||
import com.mysema.query.types.expr.EDateTimeConst;
|
||||
import com.mysema.query.types.expr.EList;
|
||||
import com.mysema.query.types.expr.EMap;
|
||||
import com.mysema.query.types.expr.ENumber;
|
||||
import com.mysema.query.types.expr.ENumberConst;
|
||||
import com.mysema.query.types.expr.EString;
|
||||
import com.mysema.query.types.expr.EStringConst;
|
||||
import com.mysema.query.types.expr.ETime;
|
||||
import com.mysema.query.types.expr.ETimeConst;
|
||||
import com.mysema.query.types.expr.*;
|
||||
|
||||
/**
|
||||
* @author tiwe
|
||||
|
||||
@ -15,16 +15,7 @@ import junit.framework.Assert;
|
||||
|
||||
import com.mysema.commons.lang.Pair;
|
||||
import com.mysema.query.types.Expr;
|
||||
import com.mysema.query.types.expr.EArray;
|
||||
import com.mysema.query.types.expr.EBoolean;
|
||||
import com.mysema.query.types.expr.ECollection;
|
||||
import com.mysema.query.types.expr.EDate;
|
||||
import com.mysema.query.types.expr.EDateTime;
|
||||
import com.mysema.query.types.expr.EList;
|
||||
import com.mysema.query.types.expr.EMap;
|
||||
import com.mysema.query.types.expr.ENumber;
|
||||
import com.mysema.query.types.expr.EString;
|
||||
import com.mysema.query.types.expr.ETime;
|
||||
import com.mysema.query.types.expr.*;
|
||||
|
||||
/**
|
||||
* The Class StandardTest.
|
||||
|
||||
@ -5,7 +5,10 @@
|
||||
*/
|
||||
package com.mysema.query;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
@ -35,7 +37,7 @@ public class BeanSerializerTest {
|
||||
type.addProperty(new Property(type, "collection", new ClassType(TypeCategory.COLLECTION, Collection.class, typeModel), new String[0]));
|
||||
type.addProperty(new Property(type, "listField", new ClassType(TypeCategory.LIST, List.class, typeModel), new String[0]));
|
||||
type.addProperty(new Property(type, "setField", new ClassType(TypeCategory.SET, Set.class, typeModel), new String[0]));
|
||||
type.addProperty(new Property(type, "arrayField", new ClassType(TypeCategory.ARRAY, String[].class, typeModel), new String[0]));
|
||||
type.addProperty(new Property(type, "arrayField", new ClassType(TypeCategory.ARRAY, String[].class), new String[0]));
|
||||
type.addProperty(new Property(type, "mapField", new ClassType(TypeCategory.MAP, List.class, typeModel, typeModel), new String[0]));
|
||||
type.addProperty(new Property(type, "superTypeField", new TypeExtends(new ClassType(TypeCategory.MAP, List.class, typeModel, typeModel)), new String[0]));
|
||||
type.addProperty(new Property(type, "extendsTypeField", new TypeSuper(new ClassType(TypeCategory.MAP, List.class, typeModel, typeModel)), new String[0]));
|
||||
@ -59,7 +61,23 @@ public class BeanSerializerTest {
|
||||
public void test() throws IOException{
|
||||
BeanSerializer serializer = new BeanSerializer();
|
||||
serializer.serialize(type, SimpleSerializerConfig.DEFAULT, new JavaWriter(writer));
|
||||
System.out.println(writer);
|
||||
String str = writer.toString();
|
||||
for (String prop : Arrays.asList(
|
||||
"String[] arrayField;",
|
||||
"Boolean boolean_;",
|
||||
"java.util.Collection<DomainClass> collection;",
|
||||
"Comparable comparable;",
|
||||
"java.util.Date date;",
|
||||
"DomainClass entityField;",
|
||||
"Object extendsTypeField;",
|
||||
"Integer integer;",
|
||||
"java.util.List<DomainClass> listField;",
|
||||
"java.util.List<DomainClass,DomainClass> mapField;",
|
||||
"java.util.Set<DomainClass> setField;",
|
||||
"java.util.List<DomainClass,DomainClass> superTypeField;",
|
||||
"java.sql.Time time;")){
|
||||
assertTrue(prop + " was not contained", str.contains(prop));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
*/
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -18,22 +18,22 @@ public class ClassTypeTest {
|
||||
|
||||
@Test
|
||||
public void asArrayType(){
|
||||
assertEquals(stringType, stringType.asArrayType().getParameter(0));
|
||||
assertEquals(stringType, stringType.asArrayType().getParameter(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void as(){
|
||||
assertEquals(TypeCategory.COMPARABLE, stringType.as(TypeCategory.COMPARABLE).getCategory());
|
||||
assertEquals(TypeCategory.COMPARABLE, stringType.as(TypeCategory.COMPARABLE).getCategory());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getParameters(){
|
||||
ClassType mapType = new ClassType(TypeCategory.MAP, Map.class, stringType, stringType);
|
||||
assertEquals(2, mapType.getParameterCount());
|
||||
assertEquals(stringType, mapType.getParameter(0));
|
||||
assertEquals(stringType, mapType.getParameter(1));
|
||||
assertEquals(stringType, mapType.getSelfOrValueType());
|
||||
assertFalse(mapType.isPrimitive());
|
||||
ClassType mapType = new ClassType(TypeCategory.MAP, Map.class, stringType, stringType);
|
||||
assertEquals(2, mapType.getParameterCount());
|
||||
assertEquals(stringType, mapType.getParameter(0));
|
||||
assertEquals(stringType, mapType.getParameter(1));
|
||||
assertEquals(stringType, mapType.getSelfOrValueType());
|
||||
assertFalse(mapType.isPrimitive());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
@ -15,17 +16,17 @@ public class MethodTest {
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
Method m1 = new Method(typeFactory.create(String.class), "method", "abc", typeFactory.create(String.class));
|
||||
Method m2 = new Method(typeFactory.create(String.class), "method", "abc", typeFactory.create(String.class));
|
||||
assertEquals(m1, m1);
|
||||
assertEquals(m1, m2);
|
||||
assertEquals(m1.hashCode(), m2.hashCode());
|
||||
Method m1 = new Method(typeFactory.create(String.class), "method", "abc", typeFactory.create(String.class));
|
||||
Method m2 = new Method(typeFactory.create(String.class), "method", "abc", typeFactory.create(String.class));
|
||||
assertEquals(m1, m1);
|
||||
assertEquals(m1, m2);
|
||||
assertEquals(m1.hashCode(), m2.hashCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createCopy(){
|
||||
Method method = new Method(typeFactory.create(String.class), "method", "abc", typeFactory.create(String.class));
|
||||
Type typeModel = new SimpleType(TypeCategory.ENTITY, "com.mysema.query.DomainClass", "com.mysema.query", "DomainClass", false);
|
||||
Method method = new Method(typeFactory.create(String.class), "method", "abc", typeFactory.create(String.class));
|
||||
Type typeModel = new SimpleType(TypeCategory.ENTITY, "com.mysema.query.DomainClass", "com.mysema.query", "DomainClass", false);
|
||||
EntityType type = new EntityType("Q", typeModel);
|
||||
assertNotNull(method.createCopy(type));
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
@ -13,13 +13,13 @@ public class PropertyTest {
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
Type typeModel = new SimpleType(TypeCategory.ENTITY, "com.mysema.query.DomainClass", "com.mysema.query", "DomainClass", false);
|
||||
Type typeModel = new SimpleType(TypeCategory.ENTITY, "com.mysema.query.DomainClass", "com.mysema.query", "DomainClass", false);
|
||||
EntityType type = new EntityType("Q", typeModel);
|
||||
Property p1 = new Property(type, "property", type, new String[0]);
|
||||
Property p2 = new Property(type, "property", type, new String[0]);
|
||||
assertEquals(p1, p1);
|
||||
assertEquals(p1, p2);
|
||||
assertEquals(p1.hashCode(), p2.hashCode());
|
||||
Property p1 = new Property(type, "property", type, new String[0]);
|
||||
Property p2 = new Property(type, "property", type, new String[0]);
|
||||
assertEquals(p1, p1);
|
||||
assertEquals(p1, p2);
|
||||
assertEquals(p1.hashCode(), p2.hashCode());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.mysema.query.functions;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package com.mysema.query.paging;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@ import org.junit.Test;
|
||||
|
||||
import com.mysema.query.types.Operator;
|
||||
import com.mysema.query.types.Ops;
|
||||
import com.mysema.query.types.path.PString;
|
||||
|
||||
public class JavaTemplatesTest {
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
*/
|
||||
package com.mysema.query.types.custom;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.sql.Time;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.mysema.query.types.expr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.mysema.query.types.expr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.mysema.query.types.expr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package com.mysema.query.types.query;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user