@Override public long doInSqlDeleteClause(SQLDeleteClause delete) { return delete.where(qAddress.customerId.eq(customer.getId())).execute(); } });
@Override public long doInSqlDeleteClause(SQLDeleteClause delete) { return delete.where(qCustomer.id.eq(customer.getId())).execute(); } });
@Override public long doInSqlDeleteClause(SQLDeleteClause delete) { return delete.where(qAddress.customerId.eq(customer.getId()).and(qAddress.id.notIn(ids))).execute(); } });
@Override public Object execute() { try (Connection connection = dataSource.getConnection()) { QProperties prop = QProperties.propProperties; cache.remove(key); new SQLDeleteClause(connection, sqlTemplates, prop) .where(prop.key.eq(key)) .execute(); } catch (SQLException e) { throw new PropertyServiceDataSourceConnectionException("Cannot connect to DataSource.", e); } return null; } });
@Override public boolean delete(final Long worklogId) { checkArgument(worklogId != null, "Cannot remove a worklog with id null."); return dbConnectionManager.executeQuery(dbConnection -> dbConnection .delete(WORKLOG) .where(WORKLOG.id.eq(worklogId)) .execute()) == 1; }
private void deleteMinusOneUserLocaleProperty(List<Long> ids, DbConnection dbConnection) { QOSPropertyEntry propertyEntry = QOSPropertyEntry.O_S_PROPERTY_ENTRY; QOSPropertyString propertyString = QOSPropertyString.O_S_PROPERTY_STRING; dbConnection.delete(propertyString).where(propertyString.id.in(ids)).execute(); dbConnection.delete(propertyEntry).where(propertyEntry.id.in(ids)).execute(); }
@Override public Boolean call(Connection connection, Configuration configuration) throws SQLException { QResource qResource = new QResource("qResource"); SQLDeleteClause deleteClause = new SQLDeleteClause(connection, configuration, qResource); long deletedRecordNum = deleteClause.where(qResource.resourceId.eq(resourceId)).execute(); return deletedRecordNum > 0; } });
private void deleteQueuedEmail(final long queuedEmailId) { querydslSupport.execute((connection, configuration) -> { QEmailQueue qEmailQueue = QEmailQueue.emailQueue; return new SQLDeleteClause(connection, configuration, qEmailQueue) .where(qEmailQueue.queuedEmailId.eq(queuedEmailId)) .execute(); }); }
@Override public boolean delete(final String principal) { long deleteCount = querydslSupport.execute((connection, configuration) -> { QSimpleSubject qSimpleSubject = QSimpleSubject.simpleSubject; return new SQLDeleteClause(connection, configuration, qSimpleSubject) .where(qSimpleSubject.principal.eq(principal)) .execute(); }); return deleteCount > 0; }
@Override public void removePermissionInheritance(final long parentResourceId, final long childResourceId) { transactionPropagator.required(() -> querydslSupport.execute((connection, configuration) -> { lockOnResource(connection, configuration, childResourceId); QPermissionInheritance permissioninheritance = QPermissionInheritance.permissionInheritance; SQLDeleteClause sql = new SQLDeleteClause(connection, configuration, permissioninheritance); sql.where( permissioninheritance.parentResourceId.eq(parentResourceId) .and(permissioninheritance.childResourceId.eq(childResourceId))) .execute(); permissionInheritanceCache.remove(childResourceId); return null; })); }
@Override public void removePermission(final long authorizedResourceId, final long targetResourceId, final String action) { Objects.requireNonNull(action); transactionPropagator.required(() -> querydslSupport.execute((connection, configuration) -> { lockOnResource(connection, configuration, authorizedResourceId); QPermission permission = QPermission.permission; SQLDeleteClause sql = new SQLDeleteClause(connection, configuration, permission); sql.where( permission.authorizedResourceId.eq(authorizedResourceId) .and(permission.targetResourceId.eq(targetResourceId)) .and(permission.action.eq(action))) .execute(); String permissionKey = generatePermissionKey(authorizedResourceId, targetResourceId, action); permissionCache.put(permissionKey, false); return null; })); }
public void removeIssueType(String id) throws RemoveException { final IssueType issueType = getIssueType(id); if (issueType != null) { try { dbConnectionManager.execute(dbConnection -> { dbConnection.delete(ISSUE_TYPE) .where(ISSUE_TYPE.id.eq(id)) .execute(); }); } finally { refreshIssueTypes(); } } else { throw new RemoveException("Issue type with id '" + id + "' does not exist."); } }
.where(a.avatarType.eq(ISSUE_TYPE_AVATAR) .and(a.systemAvatar.eq(TRUE)) .and(a.fileName.in(issueTypeIconsToReplace.keySet())))