Package com.alpaca.persistence.impl
Class AdvertiserDAOImpl
java.lang.Object
com.alpaca.persistence.impl.GenericDAOImpl<Advertiser,UUID>
com.alpaca.persistence.impl.AdvertiserDAOImpl
- All Implemented Interfaces:
IAdvertiserDAO,IGenericDAO<Advertiser,UUID>
@Component
public class AdvertiserDAOImpl
extends GenericDAOImpl<Advertiser,UUID>
implements IAdvertiserDAO
Implementation of the
IAdvertiserDAO interface for managing Advertiser entities.
Extends the generic DAO implementation (GenericDAOImpl) to provide standard CRUD
operations and advertiser-specific persistence logic.
Registered as a Spring component, with constructor injection of the AdvertiserRepo.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsByUniqueProperties(Advertiser advertiser) Determines whether an advertiser already exists based on the associated user ID.protected Class<Advertiser> Returns theAdvertiserentity class managed by this DAO.protected GenericRepo<Advertiser, UUID> getRepo()Provides the repository used by the generic DAO framework.updateById(Advertiser advertiser, UUID id) Updates an existingAdvertiseridentified by the given ID with non-null and non-blank values from the providedadvertiserobject.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
-
AdvertiserDAOImpl
public AdvertiserDAOImpl()
-
-
Method Details
-
getRepo
Provides the repository used by the generic DAO framework.- Specified by:
getRepoin classGenericDAOImpl<Advertiser,UUID> - Returns:
- the
GenericRepoforAdvertiser
-
getEntity
Returns theAdvertiserentity class managed by this DAO.- Specified by:
getEntityin classGenericDAOImpl<Advertiser,UUID> - Returns:
Advertiser.class
-
updateById
Updates an existingAdvertiseridentified by the given ID with non-null and non-blank values from the providedadvertiserobject. Only changed fields are applied. Throws aNotFoundExceptionif no matching entity is found.- Specified by:
updateByIdin interfaceIGenericDAO<Advertiser,UUID> - Parameters:
advertiser- the advertiser object containing updated valuesid- the unique identifier of the advertiser to update- Returns:
- the updated and saved
Advertiserinstance - Throws:
NotFoundException- if no advertiser exists with the specified ID
-
existsByUniqueProperties
Determines whether an advertiser already exists based on the associated user ID.- Specified by:
existsByUniquePropertiesin interfaceIGenericDAO<Advertiser,UUID> - Parameters:
advertiser- the advertiser object to check; its user must be non-null and have a non-null ID- Returns:
trueif an advertiser exists for the given user ID;falseotherwise
-