Class GroupService
java.lang.Object
com.eurodyn.qlack.fuse.lexicon.service.GroupService
A Service class for Group . It is used to implement the crud operations
- Author:
- European Dynamics SA
-
Constructor Summary
ConstructorDescriptionGroupService
(GroupRepository groupRepository, GroupMapper groupMapper, LanguageRepository languageRepository, DataRepository dataRepository) -
Method Summary
Modifier and TypeMethodDescriptioncreateGroup
(GroupDTO group) Creates a group.void
deleteGroup
(String groupID) Deletes a group.void
deleteLanguageTranslations
(String groupID, String languageID) Deletes all translations of a given group for given language.void
deleteLanguageTranslationsByLocale
(String groupID, String locale) Deletes all translation of a given group by given locale.findAll()
Fetches all groups.findByTitle
(String title) Fetches a group by given title.Fetches a group by given id.getGroupByTitle
(String groupTitle) Fetches a group by given title.Fetches all groups.long
getLastUpdateDateForLocale
(String groupID, String locale) Finds when was the last update of any key in given group for given locale.getRemainingGroups
(List<String> excludedGroupNames) Fetches all included groups.void
updateGroup
(GroupDTO group) Updates a group.
-
Constructor Details
-
GroupService
@Autowired public GroupService(GroupRepository groupRepository, GroupMapper groupMapper, LanguageRepository languageRepository, DataRepository dataRepository)
-
-
Method Details
-
createGroup
Creates a group.- Parameters:
group
- a DTO containing all information about the persisted group- Returns:
- the id of the group
-
updateGroup
Updates a group.- Parameters:
group
- a DTO containing all the information to update a persisted group
-
deleteGroup
Deletes a group.- Parameters:
groupID
- the id of the group to delete
-
getGroup
Fetches a group by given id.- Parameters:
groupID
- the id of the group- Returns:
- a DTO containing the group that matches the specific id
-
getGroupByTitle
Fetches a group by given title.- Parameters:
groupTitle
- the title of the group- Returns:
- a DTO containing the group that matches the specific title
-
findAll
Fetches all groups.- Returns:
- a list containing all persisted groups
-
findByTitle
Fetches a group by given title.- Parameters:
title
- the title of the group- Returns:
- a DTO containing the group that matches the specific title
-
getRemainingGroups
Fetches all included groups.- Parameters:
excludedGroupNames
- a list containing the names of excluded groups- Returns:
- a set of DTO containing all included groups
-
getGroups
Fetches all groups.- Returns:
- a set of DTO containing all groups
-
deleteLanguageTranslations
Deletes all translations of a given group for given language.- Parameters:
groupID
- the id of the grouplanguageID
- the id of the language
-
deleteLanguageTranslationsByLocale
Deletes all translation of a given group by given locale.- Parameters:
groupID
- the id of the grouplocale
- the locale name
-
getLastUpdateDateForLocale
Finds when was the last update of any key in given group for given locale.- Parameters:
groupID
- the group idlocale
- the locale name- Returns:
- a number representing the date of last update. The default return date is 'now'
-