From c8a1e1d841ed46bf33a2f47dc22b57af1e8e7be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Westk=C3=A4mper?= Date: Thu, 12 Nov 2009 13:43:43 +0000 Subject: [PATCH] --- .../mysema/query/types/expr/ECollection.java | 10 ++++----- .../com/mysema/query/types/expr/EList.java | 8 +++---- .../mysema/query/types/path/PCollection.java | 4 ++-- .../types/path/PComponentCollection.java | 16 +++++++------- .../query/types/path/PComponentList.java | 20 ++++++++--------- .../query/types/path/PEntityCollection.java | 22 +++++++++---------- .../mysema/query/types/path/PEntityList.java | 18 +++++++-------- .../com/mysema/query/types/path/PList.java | 4 ++-- 8 files changed, 51 insertions(+), 51 deletions(-) diff --git a/querydsl-core/src/main/java/com/mysema/query/types/expr/ECollection.java b/querydsl-core/src/main/java/com/mysema/query/types/expr/ECollection.java index 8ab358e2d..f9705960d 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/expr/ECollection.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/expr/ECollection.java @@ -11,10 +11,10 @@ package com.mysema.query.types.expr; * * @author tiwe * - * @param + * @param * @see java.util.Collection */ -public interface ECollection{ +public interface ECollection{ /** * Get an expression for this.contains(child) @@ -23,7 +23,7 @@ public interface ECollection{ * @return this.contains(child) * @see java.util.Collection#contains(Object) */ - EBoolean contains(D child); + EBoolean contains(E child); /** * Get an expression for this.contains(child) @@ -32,13 +32,13 @@ public interface ECollection{ * @return * @see java.util.Collection#contains(Object) */ - EBoolean contains(Expr child); + EBoolean contains(Expr child); /** * Get the element type of this path * */ - Class getElementType(); + Class getElementType(); /** * Get an expression for this.isEmpty() diff --git a/querydsl-core/src/main/java/com/mysema/query/types/expr/EList.java b/querydsl-core/src/main/java/com/mysema/query/types/expr/EList.java index bc2535d46..2380e2ee3 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/expr/EList.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/expr/EList.java @@ -13,10 +13,10 @@ import javax.annotation.Nonnegative; * * @author tiwe * - * @param component type + * @param component type * @see java.util.List */ -public interface EList extends ECollection { +public interface EList extends ECollection { /** * Indexed access @@ -25,7 +25,7 @@ public interface EList extends ECollection { * @return this.get(index) * @see java.util.List#get(int) */ - Expr get(Expr index); + Expr get(Expr index); /** * Indexed access @@ -34,5 +34,5 @@ public interface EList extends ECollection { * @return this.get(index) * @see java.util.List#get(int) */ - Expr get(@Nonnegative int index); + Expr get(@Nonnegative int index); } \ No newline at end of file diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PCollection.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PCollection.java index 54bde9ff9..7c9120b5e 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PCollection.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PCollection.java @@ -12,9 +12,9 @@ import com.mysema.query.types.expr.ECollection; * * @author tiwe * - * @param + * @param * @see java.util.Collection */ -public interface PCollection extends Path>, ECollection { +public interface PCollection extends Path>, ECollection { } \ No newline at end of file diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java index cd13b0f6c..e63775b20 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java @@ -20,12 +20,12 @@ import com.mysema.query.util.NotEmpty; * * @author tiwe * - * @param component type + * @param component type */ @SuppressWarnings("serial") -public class PComponentCollection extends ECollectionBase implements PCollection { +public class PComponentCollection extends ECollectionBase implements PCollection { - protected final Class type; + protected final Class type; private final Path root; @@ -34,18 +34,18 @@ public class PComponentCollection extends ECollectionBase implements PColl private volatile EBoolean isnull, isnotnull; @SuppressWarnings("unchecked") - public PComponentCollection(Class type, PathMetadata metadata) { + public PComponentCollection(Class type, PathMetadata metadata) { super((Class)Collection.class); this.type = (Class)type; this.metadata = metadata; this.root = metadata.getRoot() != null ? metadata.getRoot() : this; } - public PComponentCollection(Class type, @NotEmpty String var) { + public PComponentCollection(Class type, @NotEmpty String var) { this(type, PathMetadata.forVariable(var)); } - public PComponentCollection(Class type, Path parent, @NotEmpty String property) { + public PComponentCollection(Class type, Path parent, @NotEmpty String property) { this(type, PathMetadata.forProperty(parent, property)); } @@ -61,7 +61,7 @@ public class PComponentCollection extends ECollectionBase implements PColl } @Override - public Class getElementType() { + public Class getElementType() { return type; } @@ -97,7 +97,7 @@ public class PComponentCollection extends ECollectionBase implements PColl } @Override - public Expr> asExpr() { + public Expr> asExpr() { return this; } diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentList.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentList.java index b41e53104..150b381d7 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentList.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentList.java @@ -15,34 +15,34 @@ import com.mysema.query.types.expr.Expr; * * @author tiwe * - * @param component type + * @param component type */ @SuppressWarnings("serial") -public class PComponentList extends PComponentCollection implements PList { +public class PComponentList extends PComponentCollection implements PList { - private final Map> cache = new HashMap>(); + private final Map> cache = new HashMap>(); - public PComponentList(Class type, PathMetadata metadata) { + public PComponentList(Class type, PathMetadata metadata) { super(type, metadata); } @Override - public PSimple get(Expr index) { - return new PSimple(type, PathMetadata.forListAccess(this, index)); + public PSimple get(Expr index) { + return new PSimple(type, PathMetadata.forListAccess(this, index)); } @Override - public PSimple get(int index) { + public PSimple get(int index) { if (cache.containsKey(index)){ return cache.get(index); }else{ - PSimple rv = create(index); + PSimple rv = create(index); cache.put(index, rv); return rv; } } - private PSimple create(int index){ - return new PSimple(type, PathMetadata.forListAccess(this, index)); + private PSimple create(int index){ + return new PSimple(type, PathMetadata.forListAccess(this, index)); } } \ No newline at end of file diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java index 09aa6eba9..d7fa10c43 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java @@ -24,14 +24,14 @@ import com.mysema.query.util.NotEmpty; * * @author tiwe * - * @param component type + * @param component type */ @SuppressWarnings("serial") -public class PEntityCollection extends EEntity> implements PCollection { +public class PEntityCollection extends EEntity> implements PCollection { private final PathMetadata metadata; - protected final Class elementType; + protected final Class elementType; protected final String entityName; @@ -42,29 +42,29 @@ public class PEntityCollection extends EEntity> imple private final Path root; @SuppressWarnings("unchecked") - public PEntityCollection(Class type, @NotEmpty String entityName, PathMetadata metadata) { + public PEntityCollection(Class type, @NotEmpty String entityName, PathMetadata metadata) { super((Class)Collection.class); - this.elementType = (Class) Assert.notNull(type,"type is null"); + this.elementType = (Class) Assert.notNull(type,"type is null"); this.metadata = Assert.notNull(metadata,"metadata is null"); this.entityName = Assert.notNull(entityName,"entityName is null"); this.root = metadata.getRoot() != null ? metadata.getRoot() : this; } - public PEntityCollection(Class type, @NotEmpty String entityName, @NotEmpty String var) { + public PEntityCollection(Class type, @NotEmpty String entityName, @NotEmpty String var) { this(type, entityName, PathMetadata.forVariable(var)); } - public PEntityCollection(Class type, @NotEmpty String entityName, Path parent, @NotEmpty String property) { + public PEntityCollection(Class type, @NotEmpty String entityName, Path parent, @NotEmpty String property) { this(type, entityName, PathMetadata.forProperty(parent, property)); } @Override - public EBoolean contains(D child) { + public EBoolean contains(E child) { return OBoolean.create(Ops.IN, ExprConst.create(child), this); } @Override - public EBoolean contains(Expr child) { + public EBoolean contains(Expr child) { return OBoolean.create(Ops.IN, child, this); } @@ -80,7 +80,7 @@ public class PEntityCollection extends EEntity> imple } @Override - public Class getElementType() { + public Class getElementType() { return elementType; } @@ -146,7 +146,7 @@ public class PEntityCollection extends EEntity> imple } @Override - public Expr> asExpr() { + public Expr> asExpr() { return this; } diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java index 607eb0137..cd9e6c13a 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java @@ -15,22 +15,22 @@ import com.mysema.query.types.expr.Expr; * * @author tiwe * - * @param component type + * @param component type */ @SuppressWarnings("serial") -public class PEntityList> extends PEntityCollection implements PList { +public class PEntityList> extends PEntityCollection implements PList { - private final Class queryType; + private final Class queryType; - private final Map cache = new HashMap(); + private final Map cache = new HashMap(); - public PEntityList(Class elementType, Class queryType, PathMetadata metadata) { + public PEntityList(Class elementType, Class queryType, PathMetadata metadata) { super(elementType, elementType.getSimpleName(), metadata); this.queryType = queryType; } @Override - public E get(Expr index) { + public Q get(Expr index) { PathMetadata md = PathMetadata.forListAccess(this, index); try { return queryType.getConstructor(PathMetadata.class).newInstance(md); @@ -40,17 +40,17 @@ public class PEntityList> extends PEntityCollection i } @Override - public E get(int index) { + public Q get(int index) { if (cache.containsKey(index)){ return cache.get(index); }else{ - E rv = create(index); + Q rv = create(index); cache.put(index, rv); return rv; } } - private E create(int index){ + private Q create(int index){ PathMetadata md = PathMetadata.forListAccess(this, index); try { return queryType.getConstructor(PathMetadata.class).newInstance(md); diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PList.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PList.java index fe8fb09a7..74d569e19 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PList.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PList.java @@ -12,9 +12,9 @@ import com.mysema.query.types.expr.EList; * * @author tiwe * - * @param component type + * @param component type * @see java.util.List */ -public interface PList extends PCollection, EList { +public interface PList extends PCollection, EList { } \ No newline at end of file