mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-04 00:36:26 +00:00
introduced eh-cache as a caching provider instead of caffeine to be used in hibernate (only ram cache is currently possible)
added caching configuration for 2nd level caching in hibernate added command to clear hibernate caches changed some interfaces so the api looks a bit more consistent (return the created/updated value) split user management and user in server management added try catch block to message received listener execution, to make them independent moved some feature flag methods to the feature flag service bean instead of the management service, as they used the FeatureEnum directly fixed feature disable text always rendering removed some non embed logging fixed message embed template added exception logging to message embedding
This commit is contained in:
@@ -2,8 +2,15 @@ package dev.sheldan.abstracto.scheduling.repository;
|
||||
|
||||
import dev.sheldan.abstracto.scheduling.model.database.SchedulerJob;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.QueryHints;
|
||||
|
||||
import javax.persistence.QueryHint;
|
||||
|
||||
public interface SchedulerJobRepository extends JpaRepository<SchedulerJob, Long> {
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
boolean existsByName(String name);
|
||||
|
||||
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
|
||||
SchedulerJob findByName(String name);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package dev.sheldan.abstracto.scheduling.model.database;
|
||||
|
||||
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -29,4 +31,23 @@ public class SchedulerJob {
|
||||
private boolean active;
|
||||
|
||||
private boolean recovery;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
SchedulerJob that = (SchedulerJob) o;
|
||||
return active == that.active &&
|
||||
recovery == that.recovery &&
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(groupName, that.groupName) &&
|
||||
Objects.equals(clazz, that.clazz) &&
|
||||
Objects.equals(cronExpression, that.cronExpression);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, groupName, clazz, cronExpression, active, recovery);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user