File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
shogun-lib/src/main/java/de/terrestris/shogun/lib
model/security/permission
repository/security/permission Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1919import io .swagger .v3 .oas .annotations .media .Schema ;
2020import jakarta .persistence .*;
2121import lombok .*;
22+ import org .hibernate .annotations .Cache ;
23+ import org .hibernate .annotations .CacheConcurrencyStrategy ;
2224import org .hibernate .annotations .CreationTimestamp ;
2325import org .hibernate .annotations .UpdateTimestamp ;
2426import org .hibernate .envers .AuditTable ;
3133@ Table (schema = "shogun" )
3234@ Audited
3335@ AuditTable (value = "publicinstancepermissions_rev" , schema = "shogun_rev" )
36+ @ Cacheable
37+ @ Cache (usage = CacheConcurrencyStrategy .READ_WRITE , region ="publicinstancepermissions" )
3438@ Getter
3539@ Setter
3640@ AllArgsConstructor
Original file line number Diff line number Diff line change 1717package de .terrestris .shogun .lib .repository .security .permission ;
1818
1919import de .terrestris .shogun .lib .model .security .permission .PublicInstancePermission ;
20+ import jakarta .persistence .QueryHint ;
21+ import org .hibernate .jpa .AvailableHints ;
22+ import org .springframework .data .jpa .repository .QueryHints ;
2023import org .springframework .data .repository .CrudRepository ;
2124import org .springframework .stereotype .Repository ;
2225
2629public interface PublicInstancePermissionRepository extends CrudRepository <PublicInstancePermission , Long > {
2730 void deleteByEntityId (Long entityId );
2831
32+ @ QueryHints (@ QueryHint (name = AvailableHints .HINT_CACHEABLE , value = "true" ))
2933 Optional <PublicInstancePermission > findByEntityId (Long entityId );
3034
3135}
You can’t perform that action at this time.
0 commit comments