Interface SaleRepository
- All Superinterfaces:
CrudRepository<Sale,,Long> GenericRepository<Sale,Long>
-
Method Summary
Modifier and TypeMethodDescriptionfindAllByNameFromJson(String name) Retrieves an entity by its id.findByName(String name) findByNameFromJson(String name) getDiscountById(Long id) voidMethods inherited from interface io.micronaut.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findAll, save, saveAll, update, updateAll
-
Method Details
-
getById
-
findById
Description copied from interface:CrudRepositoryRetrieves an entity by its id.- Specified by:
findByIdin interfaceCrudRepository<Sale,Long> - Parameters:
id- The ID of the entity to retrieve. Must not be null.- Returns:
- the entity with the given id or Optional#empty() if none found
-
updateData
-
getDiscountById
@Query("SELECT extra_data AS extraData FROM sale WHERE id = :id") @QueryResult(column="extraData", type=JSON, jsonDataType=STRING) Optional<Discount> getDiscountById(Long id) -
findAllByNameFromJson
@Query("SELECT extra_data AS DATA FROM sale WHERE name = :name") @QueryResult(type=JSON, jsonDataType=STRING) List<Sale> findAllByNameFromJson(String name) -
findByNameFromJson
@Query("SELECT extra_data AS DATA FROM sale WHERE name = :name") @QueryResult(type=JSON, jsonDataType=STRING) Optional<Sale> findByNameFromJson(String name) -
findByName
-