Interface RepositoryBaseInterface<E>

Type Parameters:
E - The Type used by this Repository
All Known Implementing Classes:
ExtendedPanacheMongoRepositoryBase, ExtendedPanacheRepositoryBase

public interface RepositoryBaseInterface<E>
Interface for Repository for a Database
  • Field Details

  • Method Details

    • isSqlRepository

      boolean isSqlRepository()
      Returns:
      True if SQL based repository, else False (NoSQL)
    • getTable

      String getTable()
      Returns:
      the table name
    • getPkName

      default String getPkName()
      Returns:
      the Primary Key column name
    • addToInsertBulk

      RepositoryBaseInterface<E> addToInsertBulk(E so) throws CcsDbException
      Add one element to an insert bulk operation
      Parameters:
      so - the item to bulk (insert/update)
      Returns:
      this
      Throws:
      CcsDbException
    • flushAll

      void flushAll() throws CcsDbException
      Force flush of all remaining bulk items, and if supported other items
      Throws:
      CcsDbException
    • findOne

      E findOne(DbQuery query) throws CcsDbException
      Parameters:
      query - the where condition
      Returns:
      the item according to the query
      Throws:
      CcsDbException
    • findWithPk

      E findWithPk(String pk) throws CcsDbException
      Parameters:
      pk - the Primary Key as String
      Returns:
      the item according to the Primary Key
      Throws:
      CcsDbException
    • deleteWithPk

      void deleteWithPk(String pk) throws CcsDbException
      Delete the item according to the Primary Key
      Parameters:
      pk - the Primary Key as String
      Throws:
      CcsDbException
    • findStream

      Stream<E> findStream(DbQuery query) throws CcsDbException
      Parameters:
      query - the where condition
      Returns:
      the Stream (real one) based on Query (where condition)
      Throws:
      CcsDbException
    • findIterator

      io.clonecloudstore.common.standard.stream.ClosingIterator<E> findIterator(DbQuery query) throws CcsDbException
      Parameters:
      query - the where condition
      Returns:
      the iterator based on Query (where condition)
      Throws:
      CcsDbException
    • count

      long count(DbQuery query) throws CcsDbException
      Parameters:
      query - the where condition
      Returns:
      the count based on Query (where condition)
      Throws:
      CcsDbException
    • countAll

      long countAll() throws CcsDbException
      Returns:
      the total number of rows
      Throws:
      CcsDbException
    • delete

      long delete(DbQuery query) throws CcsDbException
      Parameters:
      query - the where condition
      Returns:
      the count of deleted items based on Query (where condition)
      Throws:
      CcsDbException
    • deleteAllDb

      long deleteAllDb() throws CcsDbException
      Returns:
      the total number of deleted rows
      Throws:
      CcsDbException
    • update

      long update(DbQuery query, DbUpdate update) throws CcsDbException
      Parameters:
      query - the where condition
      update - the update part
      Returns:
      the count of updated items based on Query (where condition) and the Update
      Throws:
      CcsDbException
    • updateFull

      boolean updateFull(E e) throws CcsDbException
      Update fully this E
      Returns:
      True if ok
      Throws:
      CcsDbException
    • insert

      void insert(E item) throws CcsDbException
      Parameters:
      item - the item to insert
      Throws:
      CcsDbException
    • createEmptyItem

      E createEmptyItem()
      Returns:
      an empty item