mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-13 19:41:38 +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:
@@ -4,10 +4,8 @@ import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.experience.models.database.ADisabledExpRole;
|
||||
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,15 +13,11 @@ import java.util.List;
|
||||
*/
|
||||
@Repository
|
||||
public interface DisabledExpRoleRepository extends JpaRepository<ADisabledExpRole, Long> {
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsByRole(ARole role);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
ADisabledExpRole findByRole(ARole role);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
void deleteByRole(ARole role);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<ADisabledExpRole> getByRole_Server(AServer server);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,9 @@ package dev.sheldan.abstracto.experience.repository;
|
||||
import dev.sheldan.abstracto.experience.models.database.AExperienceLevel;
|
||||
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;
|
||||
|
||||
@@ -18,15 +16,12 @@ import java.util.Optional;
|
||||
public interface ExperienceLevelRepository extends JpaRepository<AExperienceLevel, Integer> {
|
||||
@NotNull
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<AExperienceLevel> findById(@NonNull Integer aLong);
|
||||
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsById(@NonNull Integer aLong);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<AExperienceLevel> findAll();
|
||||
}
|
||||
|
||||
@@ -6,11 +6,9 @@ import dev.sheldan.abstracto.experience.models.database.AExperienceLevel;
|
||||
import dev.sheldan.abstracto.experience.models.database.AExperienceRole;
|
||||
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;
|
||||
|
||||
@@ -24,7 +22,6 @@ public interface ExperienceRoleRepository extends JpaRepository<AExperienceRole,
|
||||
* @param role The {@link ARole} to filter for
|
||||
* @return The {@link AExperienceRole} found or null if the query did not return any results
|
||||
*/
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<AExperienceRole> findByRole(ARole role);
|
||||
|
||||
/**
|
||||
@@ -34,7 +31,6 @@ public interface ExperienceRoleRepository extends JpaRepository<AExperienceRole,
|
||||
* @param server The {@link AServer} to search for
|
||||
* @return The list of {@link AExperienceRole} found by the given parameters
|
||||
*/
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<AExperienceRole> findByLevelAndRoleServer(AExperienceLevel level, AServer server);
|
||||
|
||||
/**
|
||||
@@ -42,11 +38,9 @@ public interface ExperienceRoleRepository extends JpaRepository<AExperienceRole,
|
||||
* @param server The {@link AServer} to load the list of {@link AExperienceRole} for
|
||||
* @return A list of {@link AExperienceRole} configured to be used on the given {@link AServer}
|
||||
*/
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<AExperienceRole> findByRoleServer(AServer server);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<AExperienceRole> findById(@NonNull Long aLong);
|
||||
}
|
||||
|
||||
@@ -7,12 +7,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.jpa.repository.QueryHints;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.persistence.QueryHint;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -27,7 +25,6 @@ public interface UserExperienceRepository extends JpaRepository<AUserExperience
|
||||
* @param server The {@link AServer} to retrieve ethe {@link AUserExperience} for
|
||||
* @return A complete list of {@link AUserExperience} of the given {@link AServer}
|
||||
*/
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<AUserExperience> findByUser_ServerReference(AServer server);
|
||||
|
||||
/**
|
||||
@@ -37,7 +34,6 @@ public interface UserExperienceRepository extends JpaRepository<AUserExperience
|
||||
* @return A list of {@link AUserExperience} of the given {@link AServer} ordered by the experience of the users, paginated by the given
|
||||
* configuration
|
||||
*/
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<AUserExperience> findTop10ByUser_ServerReferenceOrderByExperienceDesc(AServer server, Pageable pageable);
|
||||
|
||||
/**
|
||||
@@ -60,6 +56,5 @@ public interface UserExperienceRepository extends JpaRepository<AUserExperience
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<AUserExperience> findById(@NonNull Long aLong);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package dev.sheldan.abstracto.experience.models.database;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
@@ -19,8 +18,6 @@ import java.time.Instant;
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class ADisabledExpRole implements Serializable {
|
||||
|
||||
@Id
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package dev.sheldan.abstracto.experience.models.database;
|
||||
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
@@ -18,8 +17,6 @@ import java.time.Instant;
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AExperienceLevel implements Serializable {
|
||||
/**
|
||||
* The unique level from 0 to as defined in the configuration. Will be created on startup.
|
||||
|
||||
@@ -3,7 +3,6 @@ package dev.sheldan.abstracto.experience.models.database;
|
||||
import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
@@ -23,8 +22,6 @@ import java.util.List;
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AExperienceRole implements Serializable {
|
||||
|
||||
/**
|
||||
@@ -65,7 +62,6 @@ public class AExperienceRole implements Serializable {
|
||||
*/
|
||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "currentExperienceRole")
|
||||
@Builder.Default
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
private List<AUserExperience> users = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package dev.sheldan.abstracto.experience.models.database;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
@@ -22,8 +21,6 @@ import java.time.Instant;
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AUserExperience implements Serializable {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user