Package org.cyclos.impl.banking
Class AccountTypeServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
- org.cyclos.impl.banking.AccountTypeServiceImpl
-
- All Implemented Interfaces:
AccountTypeServiceLocal,CRUDServiceLocal<AccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>,AccountTypeService,CRUDService<AccountTypeDTO,AccountTypeData,AccountTypeNature>,CRUDWithConfirmationPasswordService<AccountTypeDTO,AccountTypeData,AccountTypeNature>,Service
@Service public class AccountTypeServiceImpl extends CRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature> implements AccountTypeServiceLocal
implementation forAccountTypeService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, richTextHandler, withConfirmationPassword
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description AccountTypeServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoRemove(AccountType accountType, boolean flush)May be overridden in order to perform logical removing, instead of physical removing, or to remove some extra relationships as wellprotected AccountTypeDatagetData(AccountType accountType)Returns details data for the given entitybooleanhasAccessible(InternalAccountOwner owner)Returns whether the logged user has any accessible accounts over the given owner.<A extends AccountType>
List<A>listAccessible(InternalAccountOwner owner)Returns the accessible account types over the given owner.List<AccountType>listAll()Returns a list of all account typesList<AccountType>listByCurrency(Currency currency)Returns a list of all account types of the given currencyAccountTypenewEntity(AccountTypeNature nature)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterRemove(AccountType entity)May be overridden in order to perform custom logic after removing an entityprotected voidonAfterSave(AccountType accountType, AccountType currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidpreProcessCurrentCopy(AccountTypeDTO dto, AccountType currentCopy)This method is invoked before saving the entity and also, if the log is enabled, before removing.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(AccountTypeDTO dto)<T> Page<T>search(Class<T> clazz, AccountTypeQuery params)Searches using a custom result typePage<AccountTypeWithCurrencyVO>search(AccountTypeQuery params)Searches for account types, according to the specified query parametersprotected org.apache.commons.collections4.BidiMap<Class<? extends AccountType>,Class<? extends AccountTypeDTO>>subClassMappings()Should be overridden by subclasses which handle entity / dto hierarchies.AccountTypeDTOtoDTO(AccountType type)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onBeforeRemove, onBeforeSave, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, toEntity, validate
-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, toEntity, validate
-
-
-
-
Method Detail
-
hasAccessible
public boolean hasAccessible(InternalAccountOwner owner)
Description copied from interface:AccountTypeServiceLocalReturns whether the logged user has any accessible accounts over the given owner. When null, for any account types.- Specified by:
hasAccessiblein interfaceAccountTypeServiceLocal
-
listAccessible
public <A extends AccountType> List<A> listAccessible(InternalAccountOwner owner)
Description copied from interface:AccountTypeServiceLocalReturns the accessible account types over the given owner. When null, for any account types.- Specified by:
listAccessiblein interfaceAccountTypeServiceLocal
-
listAll
public List<AccountType> listAll()
Description copied from interface:AccountTypeServiceLocalReturns a list of all account types- Specified by:
listAllin interfaceAccountTypeServiceLocal
-
listByCurrency
public List<AccountType> listByCurrency(Currency currency)
Description copied from interface:AccountTypeServiceLocalReturns a list of all account types of the given currency- Specified by:
listByCurrencyin interfaceAccountTypeServiceLocal
-
newEntity
public AccountType newEntity(AccountTypeNature nature)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<AccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>- Specified by:
newEntityin classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
search
public Page<AccountTypeWithCurrencyVO> search(AccountTypeQuery params)
Description copied from interface:AccountTypeServiceSearches for account types, according to the specified query parameters- Specified by:
searchin interfaceAccountTypeService
-
search
public <T> Page<T> search(Class<T> clazz, AccountTypeQuery params)
Description copied from interface:AccountTypeServiceLocalSearches using a custom result type- Specified by:
searchin interfaceAccountTypeServiceLocal
-
toDTO
public AccountTypeDTO toDTO(AccountType type)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<AccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>- Overrides:
toDTOin classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
doRemove
protected void doRemove(AccountType accountType, boolean flush)
Description copied from class:CRUDServiceImplMay be overridden in order to perform logical removing, instead of physical removing, or to remove some extra relationships as well- Overrides:
doRemovein classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
getData
protected AccountTypeData getData(AccountType accountType)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
onAfterRemove
protected void onAfterRemove(AccountType entity)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after removing an entity- Overrides:
onAfterRemovein classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
onAfterSave
protected void onAfterSave(AccountType accountType, AccountType currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
preProcessCurrentCopy
protected void preProcessCurrentCopy(AccountTypeDTO dto, AccountType currentCopy)
Description copied from class:CRUDServiceImplThis method is invoked before saving the entity and also, if the log is enabled, before removing. Subclasses can override it to fetch lazy relationships, etc as the current copy will be detached. In case of removing (i.e the log is enabled for this entity) the dto parameter will be null.- Overrides:
preProcessCurrentCopyin classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
resolveValidator
protected Validator resolveValidator(AccountTypeDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
subClassMappings
protected org.apache.commons.collections4.BidiMap<Class<? extends AccountType>,Class<? extends AccountTypeDTO>> subClassMappings()
Description copied from class:CRUDServiceImplShould be overridden by subclasses which handle entity / dto hierarchies. The map key should be the entity class, while the map value, the DTO class- Overrides:
subClassMappingsin classCRUDServiceImpl<AccountType,QAccountType,AccountTypeDTO,AccountTypeData,AccountTypeNature>
-
-