Nixed a bit more unneeded parameterized typing.

This commit is contained in:
Michael Bayne
2009-05-29 21:04:26 +00:00
parent cc961d14e2
commit 08122cda8b
8 changed files with 21 additions and 21 deletions
+8 -8
View File
@@ -47,13 +47,13 @@ public class Key<T extends PersistentRecord> extends WhereClause
{ {
/** Handles the matching of the key columns to its bound values. This is needed so that we can /** Handles the matching of the key columns to its bound values. This is needed so that we can
* combine a bunch of keys into a {@link KeySet}. */ * combine a bunch of keys into a {@link KeySet}. */
public static class Expression<U extends PersistentRecord> implements SQLExpression public static class Expression implements SQLExpression
{ {
public Expression (Class<U> pClass, Comparable<?>[] values) { public Expression (Class<? extends PersistentRecord> pClass, Comparable<?>[] values) {
_pClass = pClass; _pClass = pClass;
_values = values; _values = values;
} }
public Class<U> getPersistentClass () { public Class<? extends PersistentRecord> getPersistentClass () {
return _pClass; return _pClass;
} }
public Comparable<?>[] getValues () { public Comparable<?>[] getValues () {
@@ -65,7 +65,7 @@ public class Key<T extends PersistentRecord> extends WhereClause
public void addClasses (Collection<Class<? extends PersistentRecord>> classSet) { public void addClasses (Collection<Class<? extends PersistentRecord>> classSet) {
classSet.add(getPersistentClass()); classSet.add(getPersistentClass());
} }
protected Class<U> _pClass; protected Class<? extends PersistentRecord> _pClass;
protected Comparable<?>[] _values; protected Comparable<?>[] _values;
} }
@@ -167,11 +167,10 @@ public class Key<T extends PersistentRecord> extends WhereClause
return _values; return _values;
} }
// from WhereClause @Override // from WhereClause
@Override
public SQLExpression getWhereExpression () public SQLExpression getWhereExpression ()
{ {
return new Expression<T>(_pClass, _values); return new Expression(_pClass, _values);
} }
// from SQLExpression // from SQLExpression
@@ -204,7 +203,8 @@ public class Key<T extends PersistentRecord> extends WhereClause
if (!pClass.equals(_pClass)) { if (!pClass.equals(_pClass)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Class mismatch between persistent record and cache invalidator " + "Class mismatch between persistent record and cache invalidator " +
"[record=" + pClass.getSimpleName() + ", invtype=" + _pClass.getSimpleName() + "]."); "[record=" + pClass.getSimpleName() +
", invtype=" + _pClass.getSimpleName() + "].");
} }
} }
+1 -1
View File
@@ -224,7 +224,7 @@ public abstract class KeySet<T extends PersistentRecord> extends WhereClause
SQLExpression[] keyexps = new SQLExpression[_keys.length]; SQLExpression[] keyexps = new SQLExpression[_keys.length];
int ii = 0; int ii = 0;
for (Comparable<?>[] kvals : _keys) { for (Comparable<?>[] kvals : _keys) {
keyexps[ii++] = new Key.Expression<T>(_pClass, kvals); keyexps[ii++] = new Key.Expression(_pClass, kvals);
} }
return new Or(keyexps); return new Or(keyexps);
} }
@@ -117,7 +117,7 @@ public abstract class BuildVisitor implements ExpressionVisitor<Void>
return null; return null;
} }
public Void visit (Key.Expression<? extends PersistentRecord> key) public Void visit (Key.Expression key)
{ {
Class<? extends PersistentRecord> pClass = key.getPersistentClass(); Class<? extends PersistentRecord> pClass = key.getPersistentClass();
String[] keyFields = DepotUtil.getKeyFields(pClass); String[] keyFields = DepotUtil.getKeyFields(pClass);
@@ -327,7 +327,7 @@ public abstract class BuildVisitor implements ExpressionVisitor<Void>
return null; return null;
} }
public Void visit (Exists<? extends PersistentRecord> exists) public Void visit (Exists exists)
{ {
_builder.append("exists "); _builder.append("exists ");
exists.getSubClause().accept(this); exists.getSubClause().accept(this);
@@ -555,7 +555,7 @@ public abstract class BuildVisitor implements ExpressionVisitor<Void>
return null; return null;
} }
public Void visit (DropIndexClause<? extends PersistentRecord> dropIndexClause) public Void visit (DropIndexClause dropIndexClause)
{ {
_builder.append("drop index "); _builder.append("drop index ");
appendIdentifier(dropIndexClause.getName()); appendIdentifier(dropIndexClause.getName());
@@ -229,7 +229,7 @@ public class ExpressionEvaluator
return new NoValue("Non-boolean result from Where expression: " + result); return new NoValue("Non-boolean result from Where expression: " + result);
} }
public Object visit (Key.Expression<? extends PersistentRecord> key) public Object visit (Key.Expression key)
{ {
Class<? extends PersistentRecord> pClass = key.getPersistentClass(); Class<? extends PersistentRecord> pClass = key.getPersistentClass();
if (pClass != _pClass) { if (pClass != _pClass) {
@@ -259,7 +259,7 @@ public class ExpressionEvaluator
return true; return true;
} }
public Object visit (Exists<? extends PersistentRecord> exists) public Object visit (Exists exists)
{ {
throw new IllegalArgumentException("Can't evaluate expression: " + exists); throw new IllegalArgumentException("Can't evaluate expression: " + exists);
} }
@@ -324,7 +324,7 @@ public class ExpressionEvaluator
throw new IllegalArgumentException("Can't evaluate expression: " + createIndexClause); throw new IllegalArgumentException("Can't evaluate expression: " + createIndexClause);
} }
public Object visit (DropIndexClause<? extends PersistentRecord> dropIndexClause) public Object visit (DropIndexClause dropIndexClause)
{ {
throw new IllegalArgumentException("Can't evaluate expression: " + dropIndexClause); throw new IllegalArgumentException("Can't evaluate expression: " + dropIndexClause);
} }
@@ -81,13 +81,13 @@ public interface ExpressionVisitor<T>
public T visit (ValueExp value); public T visit (ValueExp value);
public T visit (IntervalExp interval); public T visit (IntervalExp interval);
public T visit (WhereClause where); public T visit (WhereClause where);
public T visit (Key.Expression<? extends PersistentRecord> key); public T visit (Key.Expression key);
public T visit (Exists<? extends PersistentRecord> exists); public T visit (Exists exists);
public T visit (SelectClause selectClause); public T visit (SelectClause selectClause);
public T visit (UpdateClause updateClause); public T visit (UpdateClause updateClause);
public T visit (DeleteClause deleteClause); public T visit (DeleteClause deleteClause);
public T visit (InsertClause insertClause); public T visit (InsertClause insertClause);
public T visit (CreateIndexClause createIndexClause); public T visit (CreateIndexClause createIndexClause);
public T visit (DropIndexClause<? extends PersistentRecord> dropIndexClause); public T visit (DropIndexClause dropIndexClause);
public T visit (Case caseExp); public T visit (Case caseExp);
} }
@@ -116,7 +116,7 @@ public class MySQLBuilder
} }
@Override @Override
public Void visit (DropIndexClause<? extends PersistentRecord> dropIndexClause) public Void visit (DropIndexClause dropIndexClause)
{ {
// MySQL's indexes are scoped on the table, not on the database, and the // MySQL's indexes are scoped on the table, not on the database, and the
// SQL syntax reflects it: DROP INDEX fooIx on fooTable // SQL syntax reflects it: DROP INDEX fooIx on fooTable
@@ -30,7 +30,7 @@ import com.samskivert.depot.impl.ExpressionVisitor;
/** /**
* Represents an DROP INDEX instruction to the database. * Represents an DROP INDEX instruction to the database.
*/ */
public class DropIndexClause<T extends PersistentRecord> public class DropIndexClause
implements QueryClause implements QueryClause
{ {
public DropIndexClause (Class<? extends PersistentRecord> pClass, String name) public DropIndexClause (Class<? extends PersistentRecord> pClass, String name)
@@ -29,7 +29,7 @@ import com.samskivert.depot.impl.ExpressionVisitor;
/** /**
* The SQL 'exists' operator. * The SQL 'exists' operator.
*/ */
public class Exists<T extends PersistentRecord> public class Exists
implements SQLOperator implements SQLOperator
{ {
public Exists (SelectClause clause) public Exists (SelectClause clause)