"fromId",
params(param("id", JavaTypes.pLONG(), "the id of the object to find")),
getDBType(),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().fromId(getDBType(), (Long) params[0]);
}
});
createMethod(
"count",
params(param("sql", JavaTypes.STRING(), "the sql for the count query"),
param("params", JavaTypes.MAP().getParameterizedType(JavaTypes.STRING(), JavaTypes.OBJECT()), "parameters", NullExpression.instance())),
JavaTypes.pLONG(),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().count(getDBType(), (String) params[0], (Map<String, Object>) params[1]);
}
});
createMethod(
"countAll",
params(),
JavaTypes.pLONG(),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().countAll(getDBType());
}
});
createMethod(
"countWhere",
params(param("sql", JavaTypes.STRING(), "the sql for the WHERE clause in the count query"),
param("params", JavaTypes.MAP().getParameterizedType(JavaTypes.STRING(), JavaTypes.OBJECT()), "parameters", NullExpression.instance())),
JavaTypes.pLONG(),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().countWhere(getDBType(), (String) params[0], (Map<String, Object>) params[1]);
}
});
createMethod(
"countLike",
params(param("template", getDBType(), "the template to use in forming the WHERE clause for the count query")),
JavaTypes.pLONG(),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().countLike(getDBType(), (IDBObject) params[0]);
}
});
createMethod(
"select",
params(param("sql", JavaTypes.STRING(), "the sql for the query"),
param("params", JavaTypes.MAP().getParameterizedType(JavaTypes.STRING(), JavaTypes.OBJECT()), "parameters", NullExpression.instance())),
TypeSystem.getByFullName("tosa.api.QueryResult").getParameterizedType(getDBType()),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().select(getDBType(), (String) params[0], (Map<String, Object>) params[1]);
}
});
createMethod(
"selectAll",
params(),
TypeSystem.getByFullName("tosa.api.QueryResult").getParameterizedType(getDBType()),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().selectAll(getDBType());
}
});
createMethod(
"selectWhere",
params(param("sql", JavaTypes.STRING(), "the sql for the WHERE clause of the query"),
param("params", JavaTypes.MAP().getParameterizedType(JavaTypes.STRING(), JavaTypes.OBJECT()), "parameters", NullExpression.instance())),
TypeSystem.getByFullName("tosa.api.QueryResult").getParameterizedType(getDBType()),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().selectWhere(getDBType(), (String) params[0], (Map<String, Object>) params[1]);
}
});
createMethod(
"selectLike",
params(param("template", getDBType(), "the template to use in forming the WHERE clause for the query")),
TypeSystem.getByFullName("tosa.api.QueryResult").getParameterizedType(getDBType()),
Modifiers.PublicStatic,
"TODO",
new IMethodCallHandler() {
@Override
public Object handleCall(Object context, Object... params) {
return getDelegate().selectLike(getDBType(), (IDBObject) params[0]);
}
});