Interface PropertiesRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<PropertiesEntity,Long>, org.springframework.data.jpa.repository.JpaRepository<PropertiesEntity,Long>, org.springframework.data.repository.ListCrudRepository<PropertiesEntity,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<PropertiesEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<PropertiesEntity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<PropertiesEntity>, org.springframework.data.repository.Repository<PropertiesEntity,Long>

public interface PropertiesRepository extends org.springframework.data.jpa.repository.JpaRepository<PropertiesEntity,Long>
This is PropertiesRepository interface. Interface for generic CRUD operations of the Properties entity. This handles the below operations.
  • Create
  • Read
  • Update
  • Delete
Author:
Infosys Equinox
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Delete PropertiesEntity by id.
    findAllByUserId(long userId)
    This is used to load the properties by user id.
    findByNameAndUserId(String name, long userId)
    This is used to load the list of properties by name and user id.
    findOneByNameAndUserId(String name, long userId)
    This is used to load the properties by name and user id.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findAllByUserId

      List<PropertiesEntity> findAllByUserId(long userId)
      This is used to load the properties by user id.
      Parameters:
      userId - Indicates the user id for loading the list of properties entity.
      Returns:
      The list of PropertiesEntity object.
    • findOneByNameAndUserId

      PropertiesEntity findOneByNameAndUserId(String name, long userId)
      This is used to load the properties by name and user id.
      Parameters:
      name - Indicates the name of the properties.
      userId - Indicates the user id of the user.
      Returns:
      The PropertiesEntity object.
    • findByNameAndUserId

      List<PropertiesEntity> findByNameAndUserId(String name, long userId)
      This is used to load the list of properties by name and user id.
      Parameters:
      name - Indicates the name of the property.
      userId - Indicates the userid for which properties gets loaded.
      Returns:
      The list of PropertiesEntity object.
    • deleteByPropertyName

      @Modifying @Query("DELETE FROM userproperties a WHERE a.name = :name") void deleteByPropertyName(@Param("name") String name)
      Delete PropertiesEntity by id.
      Parameters:
      id - It refers to the id of the PropertiesEntity which is a unique identifier. An PropertiesEntity should exists for the given PropertiesEntity id, and also the PropertiesEntity should be associated with the given Property id.