/** * Deletes some records from associated table. This method does not follow any associations. * If this model has one to many associations, you might end up with either orphan records in child * tables, or run into integrity constraint violations. However, this method if very efficient as it deletes all records * in one shot, without pre-loading them. * This method also has a side-effect: it will not mark loaded instances corresponding to deleted records as "frozen". * This means that such an instance would allow calling save() and saveIt() methods resulting DB errors, as you * would be attempting to update phantom records. * * * @param query narrows which records to delete. Example: <pre>"last_name like '%sen%'"</pre>. * @param params (optional) - list of parameters if a query is parametrized. * @return number of deleted records. */ public static int delete(String query, Object... params) { return ModelDelegate.delete(modelClass(), query, params); }
/** * Deletes some records from associated table. This method does not follow any associations. * If this model has one to many associations, you might end up with either orphan records in child * tables, or run into integrity constraint violations. However, this method if very efficient as it deletes all records * in one shot, without pre-loading them. * This method also has a side-effect: it will not mark loaded instances corresponding to deleted records as "frozen". * This means that such an instance would allow calling save() and saveIt() methods resulting DB errors, as you * would be attempting to update phantom records. * * * @param query narrows which records to delete. Example: <pre>"last_name like '%sen%'"</pre>. * @param params (optional) - list of parameters if a query is parametrized. * @return number of deleted records. */ public int delete(String query, Object... params) { return ModelDelegate.delete(this.getClass(), query, params); }
/** * Deletes some records from associated table. This method does not follow any associations. * If this model has one to many associations, you might end up with either orphan records in child * tables, or run into integrity constraint violations. However, this method if very efficient as it deletes all records * in one shot, without pre-loading them. * This method also has a side-effect: it will not mark loaded instances corresponding to deleted records as "frozen". * This means that such an instance would allow calling save() and saveIt() methods resulting DB errors, as you * would be attempting to update phantom records. * * * @param query narrows which records to delete. Example: <pre>"last_name like '%sen%'"</pre>. * @param params (optional) - list of parameters if a query is parametrized. * @return number of deleted records. */ public static int delete(String query, Object... params) { return ModelDelegate.delete(modelClass(), query, params); }