Package com.axelor.ai.db.repo
Class AiUsagePolicyRepository
java.lang.Object
com.axelor.db.JpaRepository<AiUsagePolicy>
com.axelor.ai.db.repo.AbstractAiUsagePolicyRepository
com.axelor.ai.db.repo.AiUsagePolicyRepository
- All Implemented Interfaces:
Repository<AiUsagePolicy>
-
Field Summary
Fields inherited from class com.axelor.db.JpaRepository
modelClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsave(AiUsagePolicy policy) A global policy applies to every user: the roles, groups and users it listed go.voidvalidate(AiUsagePolicy policy) Whatsave(com.axelor.ai.db.AiUsagePolicy)checks, for a policy that is not saved yet: a seed file must be valid before the policy it replaces changes.Methods inherited from class com.axelor.ai.db.repo.AbstractAiUsagePolicyRepository
findByNameMethods inherited from class com.axelor.db.JpaRepository
all, all, copy, create, fields, find, findById, findByIds, flush, getReferenceById, isPermitted, isPermitted, merge, of, persist, populate, refresh, remove, validate
-
Constructor Details
-
AiUsagePolicyRepository
public AiUsagePolicyRepository()
-
-
Method Details
-
save
A global policy applies to every user: the roles, groups and users it listed go.- Specified by:
savein interfaceRepository<AiUsagePolicy>- Overrides:
savein classJpaRepository<AiUsagePolicy>- Parameters:
policy- the entity object to save- Returns:
- an instance of the entity with saved state
- Throws:
ResponseException- titled as a validation error, asvalidate(com.axelor.ai.db.AiUsagePolicy)refuses it
-
validate
Whatsave(com.axelor.ai.db.AiUsagePolicy)checks, for a policy that is not saved yet: a seed file must be valid before the policy it replaces changes.- Throws:
IllegalArgumentException- when the policy is neither global nor lists anyone
-