From a48c93be4a7f7c0cf6cc0cac3acc44b007e8c69e Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 6 Aug 2008 12:59:06 +0000 Subject: [PATCH] From Dave: a bunch of @Override annotating and some other cleanup. --- .../jdbc/depot/CacheInvalidator.java | 2 +- .../jdbc/depot/DepotMarshaller.java | 26 +++--- .../jdbc/depot/DepotRepository.java | 14 +-- .../samskivert/jdbc/depot/EHCacheAdapter.java | 8 +- .../jdbc/depot/EntityMigration.java | 14 +-- .../jdbc/depot/FieldMarshaller.java | 88 +++++++++---------- src/java/com/samskivert/jdbc/depot/Key.java | 6 +- .../com/samskivert/jdbc/depot/Modifier.java | 2 +- .../samskivert/jdbc/depot/MySQLBuilder.java | 15 ++-- .../jdbc/depot/PostgreSQLBuilder.java | 8 +- .../jdbc/depot/operator/Arithmetic.java | 18 ++-- .../jdbc/depot/operator/Conditionals.java | 21 ++--- .../samskivert/jdbc/depot/operator/Logic.java | 6 +- .../jdbc/depot/tools/GenRecordTask.java | 4 +- 14 files changed, 104 insertions(+), 128 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/CacheInvalidator.java b/src/java/com/samskivert/jdbc/depot/CacheInvalidator.java index 3f11f38..075a791 100644 --- a/src/java/com/samskivert/jdbc/depot/CacheInvalidator.java +++ b/src/java/com/samskivert/jdbc/depot/CacheInvalidator.java @@ -42,7 +42,7 @@ public interface CacheInvalidator public void invalidate (PersistenceContext ctx) { ctx.cacheTraverse(_cacheId, new PersistenceContext.CacheEvictionFilter() { - protected boolean testForEviction (Serializable key, T record) { + @Override protected boolean testForEviction (Serializable key, T record) { return TraverseWithFilter.this.testForEviction(key, record); } }); diff --git a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java index 7991103..f74bd5f 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java +++ b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java @@ -565,7 +565,7 @@ public class DepotMarshaller // check to see if our schema version table exists, create it if not ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { liaison.createTableIfMissing( conn, SCHEMA_VERSION_TABLE, new String[] { "persistentClass", "version" }, @@ -592,7 +592,7 @@ public class DepotMarshaller } final Iterable indexen = _indexes.values(); ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { // create the table String[] primaryKeyColumns = null; if (_pkColumns != null) { @@ -640,7 +640,7 @@ public class DepotMarshaller // make sure the versions match int currentVersion = ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { String query = " select " + liaison.columnSQL("version") + " from " + liaison.tableSQL(SCHEMA_VERSION_TABLE) + @@ -693,7 +693,7 @@ public class DepotMarshaller final ColumnDefinition coldef = fmarsh.getColumnDefinition(); log.info("Adding column to " + getTableName() + ": " + fmarsh.getColumnName()); ctx.invoke(new Modifier.Simple() { - protected String createQuery (DatabaseLiaison liaison) { + @Override protected String createQuery (DatabaseLiaison liaison) { return "alter table " + liaison.tableSQL(getTableName()) + " add column " + liaison.columnSQL(fmarsh.getColumnName()) + " " + liaison.expandDefinition(coldef); @@ -709,7 +709,7 @@ public class DepotMarshaller coldef.getType().equalsIgnoreCase("datetime"))) { log.info("Assigning current time to " + fmarsh.getColumnName() + "."); ctx.invoke(new Modifier.Simple() { - protected String createQuery (DatabaseLiaison liaison) { + @Override protected String createQuery (DatabaseLiaison liaison) { // TODO: is NOW() standard SQL? return "update " + liaison.tableSQL(getTableName()) + " set " + liaison.columnSQL(fmarsh.getColumnName()) + " = NOW()"; @@ -722,7 +722,7 @@ public class DepotMarshaller if (hasPrimaryKey() && metaData.pkName == null) { log.info("Adding primary key."); ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { liaison.addPrimaryKey( conn, getTableName(), fieldsToColumns(getPrimaryKeyFields())); return 0; @@ -733,7 +733,7 @@ public class DepotMarshaller final String pkName = metaData.pkName; log.info("Dropping primary key: " + pkName); ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { liaison.dropPrimaryKey(conn, getTableName(), pkName); return 0; } @@ -750,7 +750,7 @@ public class DepotMarshaller } // but this is a new, named index, so we create it ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { liaison.addIndexToTable( conn, getTableName(), fieldsToColumns(index.fields()), ixName, index.unique()); @@ -785,7 +785,7 @@ public class DepotMarshaller final String[] colArr = colSet.toArray(new String[colSet.size()]); final String fName = indexName; ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { liaison.addIndexToTable(conn, getTableName(), colArr, fName, true); return 0; } @@ -806,7 +806,7 @@ public class DepotMarshaller // but not this one, so let's create it ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { builder.addFullTextSearch(conn, DepotMarshaller.this, recordFts); return 0; } @@ -832,7 +832,7 @@ public class DepotMarshaller // last of all (re-)initialize our value generators, since one might've been added if (_valueGenerators.size() > 0) { ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { for (ValueGenerator vg : _valueGenerators.values()) { vg.init(conn, liaison); } @@ -843,7 +843,7 @@ public class DepotMarshaller // record our new version in the database ctx.invoke(new Modifier() { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { updateVersion(conn, liaison, _schemaVersion); return 0; } @@ -916,7 +916,7 @@ public class DepotMarshaller throws PersistenceException { return ctx.invoke(new Query.TrivialQuery() { - public TableMetaData invoke (Connection conn, DatabaseLiaison dl) + @Override public TableMetaData invoke (Connection conn, DatabaseLiaison dl) throws SQLException { return new TableMetaData(conn.getMetaData(), tableName); } diff --git a/src/java/com/samskivert/jdbc/depot/DepotRepository.java b/src/java/com/samskivert/jdbc/depot/DepotRepository.java index ece90f4..b8ecd8b 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotRepository.java +++ b/src/java/com/samskivert/jdbc/depot/DepotRepository.java @@ -187,7 +187,7 @@ public abstract class DepotRepository // key will be null if record was supplied without a primary key return _ctx.invoke(new CachingModifier(record, key, key) { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { // set any auto-generated column values Set identityFields = marsh.generateFieldValues(conn, liaison, _result, false); @@ -241,7 +241,7 @@ public abstract class DepotRepository builder.newQuery(update); return _ctx.invoke(new CachingModifier(record, key, key) { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { PreparedStatement stmt = builder.prepare(conn); try { return stmt.executeUpdate(); @@ -282,7 +282,7 @@ public abstract class DepotRepository builder.newQuery(update); return _ctx.invoke(new CachingModifier(record, key, key) { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { PreparedStatement stmt = builder.prepare(conn); // clear out _result so that we don't rewrite this partial record to the cache _result = null; @@ -424,7 +424,7 @@ public abstract class DepotRepository builder.newQuery(update); return _ctx.invoke(new Modifier(invalidator) { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { PreparedStatement stmt = builder.prepare(conn); try { return stmt.executeUpdate(); @@ -556,7 +556,7 @@ public abstract class DepotRepository builder.newQuery(update); return _ctx.invoke(new Modifier(invalidator) { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { PreparedStatement stmt = builder.prepare(conn); try { return stmt.executeUpdate(); @@ -593,7 +593,7 @@ public abstract class DepotRepository final boolean[] created = new boolean[1]; _ctx.invoke(new CachingModifier(record, key, key) { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { PreparedStatement stmt = null; try { if (_key != null) { @@ -701,7 +701,7 @@ public abstract class DepotRepository builder.newQuery(delete); return _ctx.invoke(new Modifier(invalidator) { - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { PreparedStatement stmt = builder.prepare(conn); try { return stmt.executeUpdate(); diff --git a/src/java/com/samskivert/jdbc/depot/EHCacheAdapter.java b/src/java/com/samskivert/jdbc/depot/EHCacheAdapter.java index 535de9c..e4354a3 100644 --- a/src/java/com/samskivert/jdbc/depot/EHCacheAdapter.java +++ b/src/java/com/samskivert/jdbc/depot/EHCacheAdapter.java @@ -79,7 +79,7 @@ public class EHCacheAdapter public T getValue () { return value; } - public String toString () { + @Override public String toString () { return String.valueOf(value); } }; @@ -147,17 +147,17 @@ public class EHCacheAdapter /** A class to represent an explicitly Serializable concept of null for EHCache. */ protected static class NullValue implements Serializable { - public String toString () + @Override public String toString () { return ""; } - public boolean equals (Object other) + @Override public boolean equals (Object other) { return other != null && other.getClass().equals(NullValue.class); } - public int hashCode () + @Override public int hashCode () { return 1; } diff --git a/src/java/com/samskivert/jdbc/depot/EntityMigration.java b/src/java/com/samskivert/jdbc/depot/EntityMigration.java index 18593fd..edf2267 100644 --- a/src/java/com/samskivert/jdbc/depot/EntityMigration.java +++ b/src/java/com/samskivert/jdbc/depot/EntityMigration.java @@ -47,7 +47,7 @@ public abstract class EntityMigration extends Modifier _columnName = columnName; } - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { if (!liaison.tableContainsColumn(conn, _tableName, _columnName)) { // we'll accept this inconsistency log.warning(_tableName + "." + _columnName + " already dropped."); @@ -72,7 +72,7 @@ public abstract class EntityMigration extends Modifier _newColumnName = newColumnName; } - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { if (!liaison.tableContainsColumn(conn, _tableName, _oldColumnName)) { if (liaison.tableContainsColumn(conn, _tableName, _newColumnName)) { // we'll accept this inconsistency @@ -97,11 +97,11 @@ public abstract class EntityMigration extends Modifier conn, _tableName, _oldColumnName, _newColumnName, _newColumnDef) ? 1 : 0; } - public boolean runBeforeDefault () { + @Override public boolean runBeforeDefault () { return true; } - protected void init (String tableName, Map> marshallers) { + @Override protected void init (String tableName, Map> marshallers) { super.init(tableName, marshallers); _newColumnDef = marshallers.get(_newColumnName).getColumnDefinition(); } @@ -122,18 +122,18 @@ public abstract class EntityMigration extends Modifier _fieldName = fieldName; } - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { log.info("Updating type of '" + _fieldName + "' in " + _tableName); return liaison.changeColumn(conn, _tableName, _fieldName, _newColumnDef.getType(), _newColumnDef.isNullable(), _newColumnDef.isUnique(), _newColumnDef.getDefaultValue()) ? 1 : 0; } - public boolean runBeforeDefault () { + @Override public boolean runBeforeDefault () { return false; } - protected void init (String tableName, Map> marshallers) { + @Override protected void init (String tableName, Map> marshallers) { super.init(tableName, marshallers); _columnName = marshallers.get(_fieldName).getColumnName(); _newColumnDef = marshallers.get(_fieldName).getColumnDefinition(); diff --git a/src/java/com/samskivert/jdbc/depot/FieldMarshaller.java b/src/java/com/samskivert/jdbc/depot/FieldMarshaller.java index 6b9d3e0..6628749 100644 --- a/src/java/com/samskivert/jdbc/depot/FieldMarshaller.java +++ b/src/java/com/samskivert/jdbc/depot/FieldMarshaller.java @@ -227,190 +227,190 @@ public abstract class FieldMarshaller } protected static class BooleanMarshaller extends FieldMarshaller { - public Boolean getFromObject (Object po) + @Override public Boolean getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.getBoolean(po); } - public Boolean getFromSet (ResultSet rs) + @Override public Boolean getFromSet (ResultSet rs) throws SQLException { return rs.getBoolean(getColumnName()); } - public void writeToObject (Object po, Boolean value) + @Override public void writeToObject (Object po, Boolean value) throws IllegalArgumentException, IllegalAccessException { _field.setBoolean(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Boolean value) + @Override public void writeToStatement (PreparedStatement ps, int column, Boolean value) throws SQLException { ps.setBoolean(column, value); } } protected static class ByteMarshaller extends FieldMarshaller { - public Byte getFromObject (Object po) + @Override public Byte getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.getByte(po); } - public Byte getFromSet (ResultSet rs) + @Override public Byte getFromSet (ResultSet rs) throws SQLException { return rs.getByte(getColumnName()); } - public void writeToObject (Object po, Byte value) + @Override public void writeToObject (Object po, Byte value) throws IllegalArgumentException, IllegalAccessException { _field.setByte(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Byte value) + @Override public void writeToStatement (PreparedStatement ps, int column, Byte value) throws SQLException { ps.setByte(column, value); } } protected static class ShortMarshaller extends FieldMarshaller { - public Short getFromObject (Object po) + @Override public Short getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.getShort(po); } - public Short getFromSet (ResultSet rs) + @Override public Short getFromSet (ResultSet rs) throws SQLException { return rs.getShort(getColumnName()); } - public void writeToObject (Object po, Short value) + @Override public void writeToObject (Object po, Short value) throws IllegalArgumentException, IllegalAccessException { _field.setShort(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Short value) + @Override public void writeToStatement (PreparedStatement ps, int column, Short value) throws SQLException { ps.setShort(column, value); } } protected static class IntMarshaller extends FieldMarshaller { - public Integer getFromObject (Object po) + @Override public Integer getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.getInt(po); } - public Integer getFromSet (ResultSet rs) + @Override public Integer getFromSet (ResultSet rs) throws SQLException { return rs.getInt(getColumnName()); } - public void writeToObject (Object po, Integer value) + @Override public void writeToObject (Object po, Integer value) throws IllegalArgumentException, IllegalAccessException { _field.setInt(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Integer value) + @Override public void writeToStatement (PreparedStatement ps, int column, Integer value) throws SQLException { ps.setInt(column, value); } } protected static class LongMarshaller extends FieldMarshaller { - public Long getFromObject (Object po) + @Override public Long getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.getLong(po); } - public Long getFromSet (ResultSet rs) + @Override public Long getFromSet (ResultSet rs) throws SQLException { return rs.getLong(getColumnName()); } - public void writeToObject (Object po, Long value) + @Override public void writeToObject (Object po, Long value) throws IllegalArgumentException, IllegalAccessException { _field.setLong(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Long value) + @Override public void writeToStatement (PreparedStatement ps, int column, Long value) throws SQLException { ps.setLong(column, value); } } protected static class FloatMarshaller extends FieldMarshaller { - public Float getFromObject (Object po) + @Override public Float getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.getFloat(po); } - public Float getFromSet (ResultSet rs) + @Override public Float getFromSet (ResultSet rs) throws SQLException { return rs.getFloat(getColumnName()); } - public void writeToObject (Object po, Float value) + @Override public void writeToObject (Object po, Float value) throws IllegalArgumentException, IllegalAccessException { _field.setFloat(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Float value) + @Override public void writeToStatement (PreparedStatement ps, int column, Float value) throws SQLException { ps.setFloat(column, value); } } protected static class DoubleMarshaller extends FieldMarshaller { - public Double getFromObject (Object po) + @Override public Double getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.getDouble(po); } - public Double getFromSet (ResultSet rs) + @Override public Double getFromSet (ResultSet rs) throws SQLException { return rs.getDouble(getColumnName()); } - public void writeToObject (Object po, Double value) + @Override public void writeToObject (Object po, Double value) throws IllegalArgumentException, IllegalAccessException { _field.setDouble(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Double value) + @Override public void writeToStatement (PreparedStatement ps, int column, Double value) throws SQLException { ps.setDouble(column, value); } } protected static class ObjectMarshaller extends FieldMarshaller { - public Object getFromObject (Object po) + @Override public Object getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return _field.get(po); } - public Object getFromSet (ResultSet rs) + @Override public Object getFromSet (ResultSet rs) throws SQLException { return rs.getObject(getColumnName()); } - public void writeToObject (Object po, Object value) + @Override public void writeToObject (Object po, Object value) throws IllegalArgumentException, IllegalAccessException { _field.set(po, value); } - public void writeToStatement (PreparedStatement ps, int column, Object value) + @Override public void writeToStatement (PreparedStatement ps, int column, Object value) throws SQLException { ps.setObject(column, value); } } protected static class ByteArrayMarshaller extends FieldMarshaller { - public byte[] getFromObject (Object po) + @Override public byte[] getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return (byte[]) _field.get(po); } - public byte[] getFromSet (ResultSet rs) + @Override public byte[] getFromSet (ResultSet rs) throws SQLException { return rs.getBytes(getColumnName()); } - public void writeToObject (Object po, byte[] value) + @Override public void writeToObject (Object po, byte[] value) throws IllegalArgumentException, IllegalAccessException { _field.set(po, value); } - public void writeToStatement (PreparedStatement ps, int column, byte[] value) + @Override public void writeToStatement (PreparedStatement ps, int column, byte[] value) throws SQLException { ps.setBytes(column, value); } } protected static class IntArrayMarshaller extends FieldMarshaller { - public int[] getFromObject (Object po) + @Override public int[] getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return (int[]) _field.get(po); } - public int[] getFromSet (ResultSet rs) + @Override public int[] getFromSet (ResultSet rs) throws SQLException { return (int[]) rs.getObject(getColumnName()); } - public void writeToObject (Object po, int[] value) + @Override public void writeToObject (Object po, int[] value) throws IllegalArgumentException, IllegalAccessException { _field.set(po, value); } - public void writeToStatement (PreparedStatement ps, int column, int[] value) + @Override public void writeToStatement (PreparedStatement ps, int column, int[] value) throws SQLException { ps.setObject(column, value); } @@ -431,11 +431,11 @@ public abstract class FieldMarshaller } } - public ByteEnum getFromObject (Object po) + @Override public ByteEnum getFromObject (Object po) throws IllegalArgumentException, IllegalAccessException { return (ByteEnum) _field.get(po); } - public ByteEnum getFromSet (ResultSet rs) + @Override public ByteEnum getFromSet (ResultSet rs) throws SQLException { try { return (ByteEnum) _factmeth.invoke(null, rs.getByte(getColumnName())); @@ -445,11 +445,11 @@ public abstract class FieldMarshaller throw new RuntimeException(e); } } - public void writeToObject (Object po, ByteEnum value) + @Override public void writeToObject (Object po, ByteEnum value) throws IllegalArgumentException, IllegalAccessException { _field.set(po, value); } - public void writeToStatement (PreparedStatement ps, int column, ByteEnum value) + @Override public void writeToStatement (PreparedStatement ps, int column, ByteEnum value) throws SQLException { ps.setByte(column, value.toByte()); } diff --git a/src/java/com/samskivert/jdbc/depot/Key.java b/src/java/com/samskivert/jdbc/depot/Key.java index 4466438..0b748a7 100644 --- a/src/java/com/samskivert/jdbc/depot/Key.java +++ b/src/java/com/samskivert/jdbc/depot/Key.java @@ -75,8 +75,7 @@ public class Key extends WhereClause return _values; } - @Override - public boolean equals (Object obj) + @Override public boolean equals (Object obj) { if (this == obj) { return true; @@ -88,8 +87,7 @@ public class Key extends WhereClause return _pClass == other._pClass && _values.equals(other.getValues()); } - @Override - public int hashCode () + @Override public int hashCode () { return _pClass.hashCode() ^ _values.hashCode(); } diff --git a/src/java/com/samskivert/jdbc/depot/Modifier.java b/src/java/com/samskivert/jdbc/depot/Modifier.java index b6aa3a1..44c1e9f 100644 --- a/src/java/com/samskivert/jdbc/depot/Modifier.java +++ b/src/java/com/samskivert/jdbc/depot/Modifier.java @@ -41,7 +41,7 @@ public abstract class Modifier super(null); } - public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { + @Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException { Statement stmt = conn.createStatement(); try { return stmt.executeUpdate(createQuery(liaison)); diff --git a/src/java/com/samskivert/jdbc/depot/MySQLBuilder.java b/src/java/com/samskivert/jdbc/depot/MySQLBuilder.java index 6f6e164..befa693 100644 --- a/src/java/com/samskivert/jdbc/depot/MySQLBuilder.java +++ b/src/java/com/samskivert/jdbc/depot/MySQLBuilder.java @@ -56,8 +56,7 @@ public class MySQLBuilder { public class MSBuildVisitor extends BuildVisitor { - @Override - public void visit (FullTextMatch match) + @Override public void visit (FullTextMatch match) throws Exception { _builder.append("match("); @@ -73,8 +72,7 @@ public class MySQLBuilder _builder.append(") against (? in boolean mode)"); } - @Override - public void visit (DeleteClause deleteClause) + @Override public void visit (DeleteClause deleteClause) throws Exception { _builder.append("delete from "); @@ -104,17 +102,17 @@ public class MySQLBuilder super(types); } - protected void appendTableName (Class type) + @Override protected void appendTableName (Class type) { _builder.append(_types.getTableName(type)); } - protected void appendTableAbbreviation (Class type) + @Override protected void appendTableAbbreviation (Class type) { _builder.append(_types.getTableAbbreviation(type)); } - protected void appendIdentifier (String field) + @Override protected void appendIdentifier (String field) { _builder.append(field); } @@ -127,8 +125,7 @@ public class MySQLBuilder super(types, stmt); } - @Override - public void visit (FullTextMatch match) + @Override public void visit (FullTextMatch match) throws Exception { _stmt.setString(_argIdx ++, match.getQuery()); diff --git a/src/java/com/samskivert/jdbc/depot/PostgreSQLBuilder.java b/src/java/com/samskivert/jdbc/depot/PostgreSQLBuilder.java index bdd4a1d..b78f70e 100644 --- a/src/java/com/samskivert/jdbc/depot/PostgreSQLBuilder.java +++ b/src/java/com/samskivert/jdbc/depot/PostgreSQLBuilder.java @@ -58,8 +58,7 @@ public class PostgreSQLBuilder { public class PGBuildVisitor extends BuildVisitor { - @Override - public void visit (FullTextMatch match) + @Override public void visit (FullTextMatch match) throws Exception { appendIdentifier("ftsCol_" + match.getName()); @@ -79,7 +78,7 @@ public class PostgreSQLBuilder super(types); } - protected void appendIdentifier (String field) + @Override protected void appendIdentifier (String field) { _builder.append("\"").append(field).append("\""); } @@ -87,8 +86,7 @@ public class PostgreSQLBuilder public class PGBindVisitor extends BindVisitor { - @Override - public void visit (FullTextMatch match) + @Override public void visit (FullTextMatch match) throws Exception { // The tsearch2 engine takes queries on the form diff --git a/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java b/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java index 830a060..8519ad6 100644 --- a/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java +++ b/src/java/com/samskivert/jdbc/depot/operator/Arithmetic.java @@ -42,8 +42,7 @@ public abstract class Arithmetic super(column, value); } - @Override - public String operator() + @Override public String operator() { return "+"; } @@ -62,8 +61,7 @@ public abstract class Arithmetic super(column, value); } - @Override - public String operator() + @Override public String operator() { return "-"; } @@ -82,8 +80,7 @@ public abstract class Arithmetic super(column, value); } - @Override - public String operator() + @Override public String operator() { return "*"; } @@ -102,8 +99,7 @@ public abstract class Arithmetic super(column, value); } - @Override - public String operator() + @Override public String operator() { return " / "; // Pad with spaces to work-around a MySQL bug. } @@ -122,8 +118,7 @@ public abstract class Arithmetic super(column, value); } - @Override - public String operator() + @Override public String operator() { return "&"; } @@ -142,8 +137,7 @@ public abstract class Arithmetic super(column, value); } - @Override - public String operator() + @Override public String operator() { return "|"; } diff --git a/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java b/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java index 1d593b3..e1915cc 100644 --- a/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java +++ b/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java @@ -85,8 +85,7 @@ public abstract class Conditionals super(column, value); } - @Override - public String operator() + @Override public String operator() { return "="; } @@ -105,8 +104,7 @@ public abstract class Conditionals super(column, value); } - @Override - public String operator() + @Override public String operator() { return "!="; } @@ -125,8 +123,7 @@ public abstract class Conditionals super(column, value); } - @Override - public String operator() + @Override public String operator() { return "<"; } @@ -145,8 +142,7 @@ public abstract class Conditionals super(column, value); } - @Override - public String operator() + @Override public String operator() { return "<="; } @@ -165,8 +161,7 @@ public abstract class Conditionals super(column, value); } - @Override - public String operator() + @Override public String operator() { return ">"; } @@ -185,8 +180,7 @@ public abstract class Conditionals super(column, value); } - @Override - public String operator() + @Override public String operator() { return ">="; } @@ -260,8 +254,7 @@ public abstract class Conditionals super(column, value); } - @Override - public String operator() + @Override public String operator() { return " like "; } diff --git a/src/java/com/samskivert/jdbc/depot/operator/Logic.java b/src/java/com/samskivert/jdbc/depot/operator/Logic.java index 651e685..53d0450 100644 --- a/src/java/com/samskivert/jdbc/depot/operator/Logic.java +++ b/src/java/com/samskivert/jdbc/depot/operator/Logic.java @@ -47,8 +47,7 @@ public abstract class Logic super(conditions); } - @Override - public String operator() + @Override public String operator() { return "or"; } @@ -69,8 +68,7 @@ public abstract class Logic super(conditions); } - @Override - public String operator() + @Override public String operator() { return "and"; } diff --git a/src/java/com/samskivert/jdbc/depot/tools/GenRecordTask.java b/src/java/com/samskivert/jdbc/depot/tools/GenRecordTask.java index 401e641..f046b63 100644 --- a/src/java/com/samskivert/jdbc/depot/tools/GenRecordTask.java +++ b/src/java/com/samskivert/jdbc/depot/tools/GenRecordTask.java @@ -78,9 +78,7 @@ public class GenRecordTask extends Task _cloader = ClasspathUtils.getClassLoaderForPath(getProject(), pathref); } - /** - * Performs the actual work of the task. - */ + @Override public void execute () throws BuildException { if (_cloader == null) {