Even in load() we can be without a where clause, for e.g. loading a count(*) style record.
This commit is contained in:
@@ -43,7 +43,10 @@ public class FindOneQuery<T extends PersistentRecord>
|
|||||||
{
|
{
|
||||||
_marsh = ctx.getMarshaller(type);
|
_marsh = ctx.getMarshaller(type);
|
||||||
_select = new SelectClause<T>(type, _marsh.getFieldNames(), clauses);
|
_select = new SelectClause<T>(type, _marsh.getFieldNames(), clauses);
|
||||||
_select.getWhereClause().validateQueryType(type); // sanity check
|
WhereClause where = _select.getWhereClause();
|
||||||
|
if (where != null) {
|
||||||
|
_select.getWhereClause().validateQueryType(type); // sanity check
|
||||||
|
}
|
||||||
_builder = ctx.getSQLBuilder(DepotTypes.getDepotTypes(ctx, _select));
|
_builder = ctx.getSQLBuilder(DepotTypes.getDepotTypes(ctx, _select));
|
||||||
_builder.newQuery(_select);
|
_builder.newQuery(_select);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user