super(adapter, entityResolver);
this.query = query;
}
protected QueryAssembler createTranslator(Connection connection) {
QueryAssembler translator;
if (query instanceof UpdateQuery) {
translator = new UpdateTranslator();
}
else if (query instanceof DeleteQuery) {
translator = new DeleteTranslator();
}
else {
throw new CayenneRuntimeException("Can't make a translator for query "
+ query);
}
translator.setAdapter(getAdapter());
translator.setQuery(query);
translator.setEntityResolver(getEntityResolver());
translator.setConnection(connection);
return translator;
}