/** * Delete all the records with the given where expression. */ @Instrument public static int deleteAll(String whereExpression,Object... args) { return query().where(whereExpression, args).delete(); }
@Override public void cleanupAuthorizationCodes() { int result; if(null != cleanupAuthorizationCodesCommand) { result = dao.executeUpdate(cleanupAuthorizationCodesCommand, New.hashMap("now", new Date())); }else{ result = dao.createCriteriaQuery(AuthzCodeEntity.class).where("expiration <= :now", new Date()).delete(); } log.info("Cleanup {} expired authorization codes", result); }
/** * Delete all the records with the given where expression. */ @Instrument public static int deleteAll(String whereExpression) { return query().where(whereExpression).delete(); }
@Override public void cleanupAuthorizationCodes() { int result; if(null != cleanupAuthorizationCodesCommand) { result = dao.executeUpdate(cleanupAuthorizationCodesCommand, New.hashMap("now", new Date())); }else{ result = dao.createCriteriaQuery(AuthzCodeEntity.class).where("expiration <= :now", new Date()).delete(); } log.info("Cleanup {} expired authorization codes", result); }
@Instrument public static int deleteBy(String field1, Object value1, String field2, Object value2) { return query().where(field1 + "=? and " + field2 + " = ?", value1, value2).delete(); }
@Override public void removeAccessToken(Request request, OAuth2AccessToken at) { dao.createCriteriaQuery(WacAccessTokenEntity.class).where("token = ?",at.getToken()).delete(); }
@Instrument public static int deleteBy(String field,Object value) { return query().where(field + "=?",value).delete(); }
/** * Delete all the records with the given where expression. */ @Instrument @SuppressWarnings("rawtypes") public static int deleteAll(String whereExpression,Map<String, Object> params) { return ((CriteriaQuery)query().where(whereExpression).params(params)).delete(); }
protected void cleanupLogins(Date now) { int result; if(null != cleanupLoginsCommand) { result = dao.executeUpdate(cleanupLoginsCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzSSOLoginEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired sso logins", result); }
protected void cleanupRefreshTokens(Date now) { int result; if(null != cleanupRefreshTokensCommand) { result = dao.executeUpdate(cleanupRefreshTokensCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzRefreshTokenEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired refresh tokens", result); }
protected void cleanupAccessTokens(Date now) { int result; if(null != cleanupAccessTokensCommand) { result = dao.executeUpdate(cleanupAccessTokensCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzAccessTokenEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired access tokens", result); }
protected void cleanupLogins(Date now) { int result; if(null != cleanupLoginsCommand) { result = dao.executeUpdate(cleanupLoginsCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzSSOLoginEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired sso logins", result); }
protected void cleanupAccessTokens(Date now) { int result; if(null != cleanupAccessTokensCommand) { result = dao.executeUpdate(cleanupAccessTokensCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzAccessTokenEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired access tokens", result); }
protected void cleanupSessions(Date now) { int result; if(null != cleanupSessionsCommand) { result = dao.executeUpdate(cleanupSessionsCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzSSOSessionEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired sso sessions", result); }
protected void cleanupRefreshTokens(Date now) { int result; if(null != cleanupRefreshTokensCommand) { result = dao.executeUpdate(cleanupRefreshTokensCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzRefreshTokenEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired refresh tokens", result); }
protected void cleanupSessions(Date now) { int result; if(null != cleanupSessionsCommand) { result = dao.executeUpdate(cleanupSessionsCommand, New.hashMap("now",now)); }else{ result = dao.createCriteriaQuery(AuthzSSOSessionEntity.class).where("expiration <= :now",now).delete(); } log.info("Cleanup {} expired sso sessions", result); }
dao.createCriteriaQuery(joinEntity).where(joinIdFieldName1 + " = ?", id).delete();