mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-06 00:15:32 +00:00
[AB-192] removing second level cache
changing assignable role place module name fixing starboard retrieving the starstats incorrectly fixing removing user assigned roles when removing a role from assignable role place fixing not being able to remove external emote for assignable role place
This commit is contained in:
@@ -3,10 +3,8 @@ package dev.sheldan.abstracto.modmail.repository;
|
||||
import dev.sheldan.abstracto.modmail.models.database.ModMailMessage;
|
||||
import dev.sheldan.abstracto.modmail.models.database.ModMailThread;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.QueryHints;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.persistence.QueryHint;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -15,9 +13,7 @@ import java.util.Optional;
|
||||
*/
|
||||
@Repository
|
||||
public interface ModMailMessageRepository extends JpaRepository<ModMailMessage, Long> {
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ModMailMessage> findByThreadReference(ModMailThread modMailThread);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<ModMailMessage> findByMessageId(Long messageId);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,8 @@ import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.modmail.models.database.ModMailRole;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.QueryHints;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.persistence.QueryHint;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -15,12 +13,9 @@ import java.util.List;
|
||||
*/
|
||||
@Repository
|
||||
public interface ModMailRoleRepository extends JpaRepository<ModMailRole, Long> {
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsByServerAndRole(AServer server, ARole role);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
void deleteByServerAndRole(AServer server, ARole role);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ModMailRole> findByServer(AServer server);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,8 @@ import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import dev.sheldan.abstracto.modmail.models.database.ModMailThread;
|
||||
import dev.sheldan.abstracto.modmail.models.database.ModMailThreadSubscriber;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.QueryHints;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.persistence.QueryHint;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -15,12 +13,9 @@ import java.util.List;
|
||||
*/
|
||||
@Repository
|
||||
public interface ModMailSubscriberRepository extends JpaRepository<ModMailThreadSubscriber, Long> {
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ModMailThreadSubscriber> findByThreadReference(ModMailThread thread);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsBySubscriberAndThreadReference(AUserInAServer aUserInAServer, ModMailThread modMailThread);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
void deleteBySubscriberAndThreadReference(AUserInAServer aUserInAServer, ModMailThread modMailThread);
|
||||
}
|
||||
|
||||
@@ -8,11 +8,9 @@ import dev.sheldan.abstracto.modmail.models.database.ModMailThread;
|
||||
import dev.sheldan.abstracto.modmail.models.database.ModMailThreadState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.QueryHints;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.persistence.QueryHint;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -22,35 +20,25 @@ import java.util.Optional;
|
||||
@Repository
|
||||
public interface ModMailThreadRepository extends JpaRepository<ModMailThread, Long> {
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<ModMailThread> findByChannel(AChannel channel);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ModMailThread> findByUser(AUserInAServer aUserInAServer);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
ModMailThread findTopByUserOrderByClosedDesc(AUserInAServer aUserInAServer);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ModMailThread> findByUser_UserReferenceAndStateNot(AUser user, ModMailThreadState state);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsByUser_UserReferenceAndStateNot(AUser user, ModMailThreadState state);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ModMailThread> findByServerAndState(AServer server, ModMailThreadState state);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
ModMailThread findByUserAndStateNot(AUserInAServer userInAServer, ModMailThreadState state);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsByUserAndStateNot(AUserInAServer userInAServer, ModMailThreadState state);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ModMailThread> findByUserAndState(AUserInAServer userInAServer, ModMailThreadState state);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<ModMailThread> findById(@NonNull Long aLong);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user