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 TypeMethodDescriptionboolean
existsByUniqueProperties
(Advertiser advertiser) Determines whether an advertiser already exists based on the associated user ID.protected Class
<Advertiser> Returns theAdvertiser
entity 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 existingAdvertiser
identified by the given ID with non-null and non-blank values from the providedadvertiser
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
-
AdvertiserDAOImpl
public AdvertiserDAOImpl()
-
-
Method Details
-
getRepo
Provides the repository used by the generic DAO framework.- Specified by:
getRepo
in classGenericDAOImpl<Advertiser,
UUID> - Returns:
- the
GenericRepo
forAdvertiser
-
getEntity
Returns theAdvertiser
entity class managed by this DAO.- Specified by:
getEntity
in classGenericDAOImpl<Advertiser,
UUID> - Returns:
Advertiser.class
-
updateById
Updates an existingAdvertiser
identified by the given ID with non-null and non-blank values from the providedadvertiser
object. Only changed fields are applied. Throws aNotFoundException
if no matching entity is found.- Specified by:
updateById
in interfaceIGenericDAO<Advertiser,
UUID> - Parameters:
advertiser
- the advertiser object containing updated valuesid
- the unique identifier of the advertiser to update- Returns:
- the updated and saved
Advertiser
instance - 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:
existsByUniqueProperties
in interfaceIGenericDAO<Advertiser,
UUID> - Parameters:
advertiser
- the advertiser object to check; its user must be non-null and have a non-null ID- Returns:
true
if an advertiser exists for the given user ID;false
otherwise
-