Package com.axelor.ai.db.repo
Class AiProviderRepository
java.lang.Object
com.axelor.db.JpaRepository<AiProvider>
com.axelor.ai.db.repo.AbstractAiProviderRepository
com.axelor.ai.db.repo.AiProviderRepository
- All Implemented Interfaces:
Repository<AiProvider>
-
Field Summary
Fields inherited from class com.axelor.db.JpaRepository
modelClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidremove(AiProvider provider) Takes the provider, and its models, off the policies that list them first: the models go with it by cascade, pastAiModelRepository.remove(com.axelor.ai.db.AiModel).save(AiProvider entity) Re-applies the one-default-per-type rule for models saved through the provider.Methods inherited from class com.axelor.ai.db.repo.AbstractAiProviderRepository
findByCode, 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, validate
-
Constructor Details
-
AiProviderRepository
public AiProviderRepository()
-
-
Method Details
-
save
Re-applies the one-default-per-type rule for models saved through the provider.Models edited on the provider form's o2m are persisted by JPA cascade with the provider as the save root, so
AiModelRepository.save(com.axelor.ai.db.AiModel)never runs for them. Routing the defaults through it here keeps that rule in one place.- Specified by:
savein interfaceRepository<AiProvider>- Overrides:
savein classJpaRepository<AiProvider>- Parameters:
entity- the entity object to save- Returns:
- an instance of the entity with saved state
-
remove
Takes the provider, and its models, off the policies that list them first: the models go with it by cascade, pastAiModelRepository.remove(com.axelor.ai.db.AiModel).- Specified by:
removein interfaceRepository<AiProvider>- Overrides:
removein classJpaRepository<AiProvider>- Parameters:
provider- the entity object
-