Search in sources :

Example 11 with UserPreferences

use of org.motechproject.mds.domain.UserPreferences in project motech by motech.

the class UserPreferencesServiceImpl method removeUserPreferences.

@Override
@Transactional
public void removeUserPreferences(Long id, String username) {
    Entity entity = getEntity(id);
    UserPreferences userPreferences = allUserPreferences.retrieveByClassNameAndUsername(entity.getClassName(), username);
    if (userPreferences != null) {
        allUserPreferences.delete(userPreferences);
    }
}
Also used : UserPreferences(org.motechproject.mds.domain.UserPreferences) AllUserPreferences(org.motechproject.mds.repository.internal.AllUserPreferences) Entity(org.motechproject.mds.domain.Entity) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

UserPreferences (org.motechproject.mds.domain.UserPreferences)11 AllUserPreferences (org.motechproject.mds.repository.internal.AllUserPreferences)11 Entity (org.motechproject.mds.domain.Entity)8 Transactional (org.springframework.transaction.annotation.Transactional)7 Field (org.motechproject.mds.domain.Field)5 UserPreferencesDto (org.motechproject.mds.dto.UserPreferencesDto)4 HashSet (java.util.HashSet)3 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1