Interface SqliteRepository<T,ID>

Type Parameters:
T - a model class
ID - an identifier class
All Superinterfaces:
org.springframework.data.repository.CrudRepository<T,ID>, org.springframework.data.repository.PagingAndSortingRepository<T,ID>, org.springframework.data.repository.Repository<T,ID>
All Known Implementing Classes:
SqliteRepositoryImpl

@NoRepositoryBean public interface SqliteRepository<T,ID> extends org.springframework.data.repository.PagingAndSortingRepository<T,ID>
A Spring Data fragment repository interface for SQLite. This interface has a feature that's not SQLite specific but useful in some cases. CrudRepository.save(Object) depends on auto-increment id columns and CrudRepository doesn't expose `insert()` and `update()` methods. So, users always need to use SQLite's autoincrement feature on tables. For non-autoincrement ID tables, indeed there are some workarounds https://spring.io/blog/2021/09/09/spring-data-jdbc-how-to-use-custom-id-generation, but they are not straightforward. This class provides `insert()` and `update()` instead of CrudRepository.
  • Method Summary

    Modifier and Type
    Method
    Description
    insert(T instance)
     
    update(T instance)
     

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

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll

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

    findAll, findAll
  • Method Details

    • insert

      T insert(T instance)
    • update

      T update(T instance)