Package com.alpaca.persistence.impl
Class ProfileDAOImpl
- All Implemented Interfaces:
IGenericDAO<Profile,,UUID> IProfileDAO
Implementation of the
IProfileDAO interface for managing Profile entities.
Extends the generic DAO implementation (GenericDAOImpl) to provide standard CRUD
operations and custom persistence logic specific to Profile entities.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsByUniqueProperties(Profile profile) Determines whether a profile already exists based on its unique property: the associated user ID.Returns the class object representing theProfileentity managed by this DAO.protected GenericRepo<Profile, UUID> getRepo()Provides the repository used by the generic DAO framework.updateById(Profile profile, UUID id) Updates an existingProfileidentified by the given ID using non-null and non-blank values from the providedprofileobject.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
-
ProfileDAOImpl
public ProfileDAOImpl()
-
-
Method Details
-
getRepo
Provides the repository used by the generic DAO framework.- Specified by:
getRepoin classGenericDAOImpl<Profile,UUID> - Returns:
- the
GenericRepoforProfile
-
getEntity
Returns the class object representing theProfileentity managed by this DAO.- Specified by:
getEntityin classGenericDAOImpl<Profile,UUID> - Returns:
Profile.class
-
updateById
Updates an existingProfileidentified by the given ID using non-null and non-blank values from the providedprofileobject. Only fields that differ are updated. Throws aNotFoundExceptionif no matching profile is found.- Specified by:
updateByIdin interfaceIGenericDAO<Profile,UUID> - Parameters:
profile- the profile object containing updated valuesid- the unique identifier of the profile to update- Returns:
- the updated and saved
Profileinstance - Throws:
NotFoundException- if no profile exists with the specified ID
-
existsByUniqueProperties
Determines whether a profile already exists based on its unique property: the associated user ID.- Specified by:
existsByUniquePropertiesin interfaceIGenericDAO<Profile,UUID> - Parameters:
profile- the profile to check; must include a user with a non-null ID- Returns:
trueif a profile exists for the given user ID;falseotherwise
-