mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-14 03:45:57 +00:00
[AB-57] [AB-61] reworked commands and services to work with completable futures and moved the database operations to the very last operation so we have transaction safety in more areas
added some cache annotations to the default repository functions reworked how the undo cations are processed within commands, they are executed in a post command listener when the state is error added a counter id to generate ids to be unique within servers, changed a few tables to be unique within a server added future utils class for wrapping a list of futures into one moved abstracto tables to separate schema in the installer refactored experience gain to work with more futures and delayed database access
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
package dev.sheldan.abstracto.templating.repository;
|
||||
|
||||
import dev.sheldan.abstracto.templating.model.database.AutoLoadMacro;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
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;
|
||||
|
||||
@Repository
|
||||
public interface AutoLoadMacroRepository extends JpaRepository<AutoLoadMacro, String> {
|
||||
@NotNull
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
List<AutoLoadMacro> findAll();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
package dev.sheldan.abstracto.templating.repository;
|
||||
|
||||
import dev.sheldan.abstracto.templating.model.database.Template;
|
||||
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.Optional;
|
||||
|
||||
/**
|
||||
* Repository used to load the templates from the database.
|
||||
*/
|
||||
@Repository
|
||||
public interface TemplateRepository extends JpaRepository<Template, String> {
|
||||
@NotNull
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
Optional<Template> findById(@NonNull String aLong);
|
||||
|
||||
@Override
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsById(@NonNull String aLong);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user