Class ProfileDAOImpl

java.lang.Object
com.alpaca.persistence.impl.GenericDAOImpl<Profile,UUID>
com.alpaca.persistence.impl.ProfileDAOImpl
All Implemented Interfaces:
IGenericDAO<Profile,UUID>, IProfileDAO

@Component public class ProfileDAOImpl extends GenericDAOImpl<Profile,UUID> implements 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 Details

  • Constructor Details

    • ProfileDAOImpl

      public ProfileDAOImpl()
  • Method Details

    • getRepo

      protected GenericRepo<Profile,UUID> getRepo()
      Provides the repository used by the generic DAO framework.
      Specified by:
      getRepo in class GenericDAOImpl<Profile,UUID>
      Returns:
      the GenericRepo for Profile
    • getEntity

      protected Class<Profile> getEntity()
      Returns the class object representing the Profile entity managed by this DAO.
      Specified by:
      getEntity in class GenericDAOImpl<Profile,UUID>
      Returns:
      Profile.class
    • updateById

      public Profile updateById(Profile profile, UUID id)
      Updates an existing Profile identified by the given ID using non-null and non-blank values from the provided profile object. Only fields that differ are updated. Throws a NotFoundException if no matching profile is found.
      Specified by:
      updateById in interface IGenericDAO<Profile,UUID>
      Parameters:
      profile - the profile object containing updated values
      id - 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

      public boolean existsByUniqueProperties(Profile profile)
      Determines whether a profile already exists based on its unique property: the associated user ID.
      Specified by:
      existsByUniqueProperties in interface IGenericDAO<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