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 TypeMethodDescriptionboolean
existsByUniqueProperties
(Profile profile) Determines whether a profile already exists based on its unique property: the associated user ID.Returns the class object representing theProfile
entity 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 existingProfile
identified by the given ID using non-null and non-blank values from the providedprofile
object.Methods inherited from class com.alpaca.persistence.impl.GenericDAOImpl
deleteById, existsAllByIds, existsById, findAll, findAllByIds, findAllPage, findById, save, saveAll
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getRepo
in classGenericDAOImpl<Profile,
UUID> - Returns:
- the
GenericRepo
forProfile
-
getEntity
Returns the class object representing theProfile
entity managed by this DAO.- Specified by:
getEntity
in classGenericDAOImpl<Profile,
UUID> - Returns:
Profile.class
-
updateById
Updates an existingProfile
identified by the given ID using non-null and non-blank values from the providedprofile
object. Only fields that differ are updated. Throws aNotFoundException
if no matching profile is found.- Specified by:
updateById
in interfaceIGenericDAO<Profile,
UUID> - Parameters:
profile
- the profile object containing updated valuesid
- the unique identifier of the profile to update- Returns:
- the updated and saved
Profile
instance - 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:
existsByUniqueProperties
in interfaceIGenericDAO<Profile,
UUID> - Parameters:
profile
- the profile to check; must include a user with a non-null ID- Returns:
true
if a profile exists for the given user ID;false
otherwise
-