From e862cbc90c0cd54226f3b11ddfb11fdc4c18059f Mon Sep 17 00:00:00 2001 From: dishenggg Date: Tue, 16 Apr 2024 10:56:31 +0000 Subject: [PATCH] Remove method from logic and db --- src/main/java/teammates/sqllogic/api/Logic.java | 9 --------- .../sqllogic/core/AccountRequestsLogic.java | 8 -------- .../storage/sqlapi/AccountRequestsDb.java | 14 -------------- 3 files changed, 31 deletions(-) diff --git a/src/main/java/teammates/sqllogic/api/Logic.java b/src/main/java/teammates/sqllogic/api/Logic.java index 53d90026646..a70ea6b255d 100644 --- a/src/main/java/teammates/sqllogic/api/Logic.java +++ b/src/main/java/teammates/sqllogic/api/Logic.java @@ -104,15 +104,6 @@ public AccountRequest getAccountRequest(UUID id) { return accountRequestLogic.getAccountRequest(id); } - /** - * Gets the account request with the given email and institute. - * - * @return account request with the given email and institute. - */ - public AccountRequest getAccountRequest(String email, String institute) { - return accountRequestLogic.getAccountRequest(email, institute); - } - /** * Gets the account request with the given {@code id}. * diff --git a/src/main/java/teammates/sqllogic/core/AccountRequestsLogic.java b/src/main/java/teammates/sqllogic/core/AccountRequestsLogic.java index 2e5af513560..996e52abb0a 100644 --- a/src/main/java/teammates/sqllogic/core/AccountRequestsLogic.java +++ b/src/main/java/teammates/sqllogic/core/AccountRequestsLogic.java @@ -74,14 +74,6 @@ public AccountRequest getAccountRequest(UUID id) { return accountRequestDb.getAccountRequest(id); } - /** - * Gets account request associated with the {@code email} and {@code institute}. - */ - public AccountRequest getAccountRequest(String email, String institute) { - - return accountRequestDb.getAccountRequest(email, institute); - } - /** * Gets the account request associated with the {@code id}. */ diff --git a/src/main/java/teammates/storage/sqlapi/AccountRequestsDb.java b/src/main/java/teammates/storage/sqlapi/AccountRequestsDb.java index 499781a314e..c0fc9c74b0b 100644 --- a/src/main/java/teammates/storage/sqlapi/AccountRequestsDb.java +++ b/src/main/java/teammates/storage/sqlapi/AccountRequestsDb.java @@ -63,20 +63,6 @@ public AccountRequest getAccountRequest(UUID id) { return HibernateUtil.get(AccountRequest.class, id); } - /** - * Get AccountRequest by {@code email} and {@code institute} from database. - */ - public AccountRequest getAccountRequest(String email, String institute) { - CriteriaBuilder cb = HibernateUtil.getCriteriaBuilder(); - CriteriaQuery cr = cb.createQuery(AccountRequest.class); - Root root = cr.from(AccountRequest.class); - cr.select(root).where(cb.and(cb.equal( - root.get("email"), email), cb.equal(root.get("institute"), institute))); - - TypedQuery query = HibernateUtil.createQuery(cr); - return query.getResultStream().findFirst().orElse(null); - } - /** * Get all Account Requests with {@code status} of 'pending'. */