/** * Delete the collection of Contents, cascading * * @param contentsCollection * contents collection * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(Collection<Contents> contentsCollection) throws SQLException { return deleteCascade(contentsCollection, false); }
/** * Delete the Contents matching the prepared query, cascading * * @param preparedDelete * prepared delete query * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(PreparedQuery<Contents> preparedDelete) throws SQLException { return deleteCascade(preparedDelete, false); }
/** * Delete the collection of Contents, cascading optionally including the * user table * * @param contentsCollection * contents collection * @param userTable * true if a user table * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(Collection<Contents> contentsCollection, boolean userTable) throws SQLException { int count = 0; if (contentsCollection != null) { for (Contents contents : contentsCollection) { count += deleteCascade(contents, userTable); } } return count; }
/** * Delete the Contents matching the prepared query, cascading optionally * including the user table * * @param preparedDelete * prepared delete query * @param userTable * true if a user table * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(PreparedQuery<Contents> preparedDelete, boolean userTable) throws SQLException { int count = 0; if (preparedDelete != null) { List<Contents> contentsList = query(preparedDelete); count = deleteCascade(contentsList, userTable); } return count; }
/** * Delete the Contents, cascading optionally including the user table * * @param contents * contents * @param userTable * true if a user table * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(Contents contents, boolean userTable) throws SQLException { int count = deleteCascade(contents); if (userTable) { dropTable(contents.getTableName()); } return count; }
/** * Delete a Contents by id, cascading optionally including the user table * * @param id * id * @param userTable * true if a user table * @return deleted count * @throws SQLException * upon deletion error */ public int deleteByIdCascade(String id, boolean userTable) throws SQLException { int count = 0; if (id != null) { Contents contents = queryForId(id); if (contents != null) { count = deleteCascade(contents, userTable); } else if (userTable) { dropTable(id); } } return count; }
dao.deleteCascade(contents); } else { dao.delete(contents); deleted = dao.deleteCascade(query); } else { DeleteBuilder<Contents, String> db = dao.deleteBuilder();
if (!contentsCollection.isEmpty()) { ContentsDao dao = getContentsDao(); dao.deleteCascade(contentsCollection);