Package io.jmix.appsettings.impl
Class AppSettingsToolsImpl
java.lang.Object
io.jmix.appsettings.impl.AppSettingsToolsImpl
- All Implemented Interfaces:
AppSettingsTools
@NullMarked
@Component("appset_AppSettingsTools")
public class AppSettingsToolsImpl
extends Object
implements AppSettingsTools
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AppSettingsPropertiesprotected DataManagerprotected DatatypeRegistryprotected FetchPlansprotected static final intprotected Metadataprotected MetadataToolsprotected Sequencesprotected StoreAwareLocatorprotected static final intprotected static final Stringprotected static final Stringprotected AppSettingsTenantSupportprotected UnconstrainedDataManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FetchPlancreateFetchPlan(Class<?> clazz) protected <T extends AppSettingsEntity>
TcreateGlobalAppSettingsEntity(Class<T> clazz) protected <T extends AppSettingsEntity>
TcreateTenantAppSettingsEntity(Class<T> clazz, String tenantId) protected <T extends AppSettingsEntity>
longgenerateTenantSpecificSettingsId(Class<T> clazz) Generates a synthetic identifier for a tenant-specific App Settings record.protected UnconstrainedDataManager@Nullable ObjectgetDefaultPropertyValue(Class<? extends AppSettingsEntity> clazz, String propertyName) Returns default value for providedpropertyNameandclazzbased on value of one of the AppSettingsDefault annotation.<T extends AppSettingsEntity>
List<String> getPropertyNames(Class<T> clazz) Returns all non-system properties' names for givenclazz.@Nullable ObjectgetPropertyValue(Class<? extends AppSettingsEntity> clazz, String propertyName) Returns actual value for providedpropertyNameandclazz.protected StringgetTenantSettingsSequenceName(MetaClass metaClass) <T extends AppSettingsEntity>
TloadAppSettingsEntityFromDataStore(Class<T> clazz, AppSettingsEntityLoadMode mode, boolean softDeletion) Loads application settings entity by itsclazzfrom data store according to providedAppSettingsEntityLoadModeand soft deletion hint.protected <T extends AppSettingsEntity>
@Nullable TloadGlobalAppSettingsEntity(Class<T> clazz, boolean softDeletion) protected <T extends AppSettingsEntity>
@Nullable TloadTenantSpecificAppSettingsEntity(Class<T> clazz, String tenantId, boolean softDeletion) protected <T extends AppSettingsEntity>
TrestoreSoftDeletedEntity(T entity) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.appsettings.AppSettingsTools
loadAppSettingsEntityFromDataStore, loadAppSettingsEntityFromDataStore, loadAppSettingsEntityFromDataStore
-
Field Details
-
LEGACY_GLOBAL_ENTITY_ID
protected static final int LEGACY_GLOBAL_ENTITY_ID- See Also:
-
TENANT_ENTITY_ID_SEQUENCE_START
protected static final int TENANT_ENTITY_ID_SEQUENCE_START- See Also:
-
TENANT_SETTINGS_SEQUENCE_NAME_PREFIX
- See Also:
-
TENANT_ID_PROPERTY
- See Also:
-
metadata
-
metadataTools
-
dataManager
-
unconstrainedDataManager
-
datatypeRegistry
-
appSettingsProperties
-
fetchPlans
-
storeAwareLocator
-
sequences
-
tenantSupport
-
-
Constructor Details
-
AppSettingsToolsImpl
public AppSettingsToolsImpl()
-
-
Method Details
-
loadAppSettingsEntityFromDataStore
public <T extends AppSettingsEntity> T loadAppSettingsEntityFromDataStore(Class<T> clazz, AppSettingsEntityLoadMode mode, boolean softDeletion) Description copied from interface:AppSettingsToolsLoads application settings entity by itsclazzfrom data store according to providedAppSettingsEntityLoadModeand soft deletion hint.- Specified by:
loadAppSettingsEntityFromDataStorein interfaceAppSettingsTools- Parameters:
clazz- class that extendsAppSettingsEntitymode- load modesoftDeletion- whether soft-deleted entities should be filtered out- Returns:
- application settings entity
-
getPropertyValue
public @Nullable Object getPropertyValue(Class<? extends AppSettingsEntity> clazz, String propertyName) Description copied from interface:AppSettingsToolsReturns actual value for providedpropertyNameandclazz.- Specified by:
getPropertyValuein interfaceAppSettingsTools- Parameters:
clazz- class that extendsAppSettingsEntitypropertyName- property name for which value should be calculated- Returns:
- actual value of provided
propertyName
-
getDefaultPropertyValue
public @Nullable Object getDefaultPropertyValue(Class<? extends AppSettingsEntity> clazz, String propertyName) Description copied from interface:AppSettingsToolsReturns default value for providedpropertyNameandclazzbased on value of one of the AppSettingsDefault annotation.- Specified by:
getDefaultPropertyValuein interfaceAppSettingsTools- Parameters:
clazz- class that extendsAppSettingsEntitypropertyName- property name for which default value should be calculated- Returns:
- value by default of provided
propertyName
-
getDataManagerForAppSettingsEntity
-
createFetchPlan
-
getPropertyNames
Description copied from interface:AppSettingsToolsReturns all non-system properties' names for givenclazz.- Specified by:
getPropertyNamesin interfaceAppSettingsTools- Parameters:
clazz- class that extendsAppSettingsEntity- Returns:
- non-system properties' names for given
clazz
-
loadTenantSpecificAppSettingsEntity
protected <T extends AppSettingsEntity> @Nullable T loadTenantSpecificAppSettingsEntity(Class<T> clazz, String tenantId, boolean softDeletion) -
loadGlobalAppSettingsEntity
protected <T extends AppSettingsEntity> @Nullable T loadGlobalAppSettingsEntity(Class<T> clazz, boolean softDeletion) -
createGlobalAppSettingsEntity
-
createTenantAppSettingsEntity
protected <T extends AppSettingsEntity> T createTenantAppSettingsEntity(Class<T> clazz, String tenantId) -
generateTenantSpecificSettingsId
Generates a synthetic identifier for a tenant-specific App Settings record. The legacy global record keeps the reserved identifier1. -
restoreSoftDeletedEntity
-
getTenantSettingsSequenceName
-