提交 e38a0a80 authored 作者: Thomas Mueller's avatar Thomas Mueller

Cleanup:

- Improve Javadoc documentation
- Javadoc: add missing documentation for <T> (the IDE or checkstyle flags this) 
- Javadoc: removed trailing whitespace
- Remove @Override tag because this won't compile with JDK 5
- Flag that there is something wrong (what if 'y' isn't a Number? anyway instanceof should be avoided)
上级 631e7a00
......@@ -7,8 +7,9 @@
package org.h2.jaqu;
/**
* This class represents a "column=(column + 1)" token for a SET statement.
* This class represents "SET column = (column + 1)" in an UPDATE statement.
*
* @param <T> the query type
* @param <A> the new value data type
*/
//## Java 1.5 begin ##
......@@ -22,25 +23,27 @@ public class IncrementColumn<T, A> implements Declaration {
this.query = query;
this.x = x;
}
public Query<T> by(A y) {
query.addDeclarationToken(this);
this.y = y;
return query;
}
@Override
public void appendSQL(SQLStatement stat) {
query.appendSQL(stat, x);
stat.appendSQL("=(");
query.appendSQL(stat, x);
int todoSomethingWrongHere;
if (y instanceof Number) {
Number n = (Number) y;
if (n.doubleValue() > 0)
if (n.doubleValue() > 0) {
stat.appendSQL("+");
}
}
stat.appendSQL(y.toString());
stat.appendSQL(")");
}
}
}
//## Java 1.5 end ##
......@@ -57,7 +57,6 @@ public interface SQLDialect {
*/
public static class DefaultSQLDialect implements SQLDialect {
@Override
public String tableName(String schema, String table) {
if (StringUtils.isNullOrEmpty(schema)) {
return table;
......@@ -65,7 +64,6 @@ public interface SQLDialect {
return schema + "." + table;
}
@Override
public String createIndex(String schema, String table, IndexDefinition index) {
StatementBuilder buff = new StatementBuilder();
buff.append("CREATE ");
......@@ -95,12 +93,10 @@ public interface SQLDialect {
return buff.toString();
}
@Override
public void appendLimit(SQLStatement stat, long limit) {
stat.appendSQL(" LIMIT " + limit);
}
@Override
public void appendOffset(SQLStatement stat, long offset) {
stat.appendSQL(" OFFSET " + offset);
}
......
......@@ -7,8 +7,9 @@
package org.h2.jaqu;
/**
* This class represents a "column=value" token for a SET statement.
* This class represents "SET column = value" in an UPDATE statement.
*
* @param <T> the query type
* @param <A> the new value data type
*/
//## Java 1.5 begin ##
......@@ -22,18 +23,18 @@ public class SetColumn<T, A> implements Declaration {
this.query = query;
this.x = x;
}
public Query<T> to(A y) {
query.addDeclarationToken(this);
this.y = y;
return query;
}
@Override
public void appendSQL(SQLStatement stat) {
query.appendSQL(stat, x);
stat.appendSQL("=?");
stat.addParameter(y);
}
}
//## Java 1.5 end ##
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论