Package com.alpaca.persistence.impl
Class PermissionDAOImpl
java.lang.Object
com.alpaca.persistence.impl.GenericDAOImpl<Permission,UUID>
com.alpaca.persistence.impl.PermissionDAOImpl
- All Implemented Interfaces:
IGenericDAO<Permission,,UUID> IPermissionDAO
@Component
public class PermissionDAOImpl
extends GenericDAOImpl<Permission,UUID>
implements IPermissionDAO
Implementation of the
IPermissionDAO interface for managing Permission entities.
Extends the generic DAO implementation (GenericDAOImpl) to provide standard CRUD
operations and permission-specific persistence logic.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsByUniqueProperties(Permission permission) Determines whether a permission with the same name already exists.findByPermissionName(String permissionName) Searches for aPermissionentity by its permission name.protected Class<Permission> Returns thePermissionentity class managed by this DAO.protected GenericRepo<Permission, UUID> getRepo()Provides the repository used by the generic DAO framework.updateById(Permission permission, UUID id) Updates an existingPermissionidentified by the given ID with the non-null and non-blank values from the providedpermissionobject.Methods inherited from class com.alpaca.persistence.impl.GenericDAOImpl
deleteById, existsAllByIds, existsById, findAll, findAllByIds, findAllPage, findById, save, saveAllMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.alpaca.persistence.IGenericDAO
deleteById, existsAllByIds, existsById, findAll, findAllByIds, findAllPage, findById, save, saveAll
-
Field Details
-
repo
-
-
Constructor Details
-
PermissionDAOImpl
public PermissionDAOImpl()
-
-
Method Details
-
getRepo
Provides the repository used by the generic DAO framework.- Specified by:
getRepoin classGenericDAOImpl<Permission,UUID> - Returns:
- the
GenericRepoforPermission
-
getEntity
Returns thePermissionentity class managed by this DAO.- Specified by:
getEntityin classGenericDAOImpl<Permission,UUID> - Returns:
Permission.class
-
updateById
Updates an existingPermissionidentified by the given ID with the non-null and non-blank values from the providedpermissionobject. Only changed fields are applied. Throws aNotFoundExceptionif no matching entity is found.- Specified by:
updateByIdin interfaceIGenericDAO<Permission,UUID> - Parameters:
permission- the permission object containing updated valuesid- the unique identifier of the permission to update- Returns:
- the updated and saved
Permissioninstance - Throws:
NotFoundException- if no permission exists with the specified ID
-
existsByUniqueProperties
Determines whether a permission with the same name already exists.- Specified by:
existsByUniquePropertiesin interfaceIGenericDAO<Permission,UUID> - Parameters:
permission- the permission to check; its name must be non-null and non-blank- Returns:
trueif a permission with the same name exists;falseotherwise
-
findByPermissionName
Searches for aPermissionentity by its permission name.- Specified by:
findByPermissionNamein interfaceIPermissionDAO- Parameters:
permissionName- the name of the permission to search for; may be null or blank- Returns:
- an
Optionalcontaining the found permission, or empty if none found
-