Class ExtendedPanacheRepositoryBase<F,E extends F>
java.lang.Object
io.clonecloudstore.common.database.postgre.ExtendedPanacheRepositoryBase<F,E>
- Type Parameters:
E
- the type for the DTO to use
- All Implemented Interfaces:
RepositoryBaseInterface<F>
,io.quarkus.hibernate.orm.panache.PanacheRepositoryBase<E,
String>
public abstract class ExtendedPanacheRepositoryBase<F,E extends F>
extends Object
implements io.quarkus.hibernate.orm.panache.PanacheRepositoryBase<E,String>, RepositoryBaseInterface<F>
The base Postgre implementation of the RepositoryBaseInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PostgreBulkHelper
protected final PostgreStreamHelper
<F, E> Fields inherited from interface io.clonecloudstore.common.database.utils.RepositoryBaseInterface
ID, ID_PG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddToInsertBulk
(F so) SHall be in an enclosing Transactional to enforce bulk effectsaddToUpdateBulk
(F so) SHall be in an enclosing Transactional to enforce bulk effectsprotected void
changeBulkSize
(int bulkSize) long
long
countAll()
long
long
void
deleteWithPk
(String pk) Delete the item according to the Primary KeyfindIterator
(DbQuery query) org.hibernate.query.Query
<E> Build the SELECT Hibernate Query from the DbQueryfindStream
(DbQuery query) findWithPk
(String pk) void
flushAll()
Force flush of all remaining bulk items, and if supported other itemsprotected int
org.hibernate.query.Query
<E> getSelectQuery
(DbQuery dbQuery) Build the SELECT Hibernate Query from the DbQueryvoid
boolean
long
boolean
updateFull
(F item) Update fully this EMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.quarkus.hibernate.orm.panache.PanacheRepositoryBase
count, count, count, count, delete, delete, delete, delete, deleteAll, deleteById, find, find, find, find, find, find, findAll, findAll, findById, findById, findByIdOptional, findByIdOptional, flush, getEntityManager, isPersistent, list, list, list, list, list, list, listAll, listAll, persist, persist, persist, persist, persistAndFlush, stream, stream, stream, stream, stream, stream, streamAll, streamAll, update, update, update
Methods inherited from interface io.clonecloudstore.common.database.utils.RepositoryBaseInterface
createEmptyItem, getPkName, getTable
-
Field Details
-
streamHelper
-
helper
-
-
Constructor Details
-
ExtendedPanacheRepositoryBase
-
-
Method Details
-
isSqlRepository
public boolean isSqlRepository()- Specified by:
isSqlRepository
in interfaceRepositoryBaseInterface<F>
- Returns:
- True if SQL based repository, else False (NoSQL)
-
changeBulkSize
protected void changeBulkSize(int bulkSize) -
getBulkSize
protected int getBulkSize() -
addToInsertBulk
SHall be in an enclosing Transactional to enforce bulk effects- Specified by:
addToInsertBulk
in interfaceRepositoryBaseInterface<F>
- Parameters:
so
- the item to bulk (insert/update)- Returns:
- this
- Throws:
CcsDbException
-
addToUpdateBulk
SHall be in an enclosing Transactional to enforce bulk effects- Throws:
CcsDbException
-
flushAll
Description copied from interface:RepositoryBaseInterface
Force flush of all remaining bulk items, and if supported other items- Specified by:
flushAll
in interfaceRepositoryBaseInterface<F>
- Throws:
CcsDbException
-
findOne
- Specified by:
findOne
in interfaceRepositoryBaseInterface<F>
- Parameters:
query
- the where condition- Returns:
- the item according to the query
- Throws:
CcsDbException
-
findWithPk
- Specified by:
findWithPk
in interfaceRepositoryBaseInterface<F>
- Parameters:
pk
- the Primary Key as String- Returns:
- the item according to the Primary Key
- Throws:
CcsDbException
-
deleteWithPk
Description copied from interface:RepositoryBaseInterface
Delete the item according to the Primary Key- Specified by:
deleteWithPk
in interfaceRepositoryBaseInterface<F>
- Parameters:
pk
- the Primary Key as String- Throws:
CcsDbException
-
findStream
- Specified by:
findStream
in interfaceRepositoryBaseInterface<F>
- Parameters:
query
- the where condition- Returns:
- the Stream (real one) based on Query (where condition)
- Throws:
CcsDbException
-
findIterator
- Specified by:
findIterator
in interfaceRepositoryBaseInterface<F>
- Parameters:
query
- the where condition- Returns:
- the iterator based on Query (where condition)
- Throws:
CcsDbException
-
count
- Specified by:
count
in interfaceRepositoryBaseInterface<F>
- Parameters:
query
- the where condition- Returns:
- the count based on Query (where condition)
- Throws:
CcsDbException
-
countAll
- Specified by:
countAll
in interfaceRepositoryBaseInterface<F>
- Returns:
- the total number of rows
- Throws:
CcsDbException
-
deleteAllDb
- Specified by:
deleteAllDb
in interfaceRepositoryBaseInterface<F>
- Returns:
- the total number of deleted rows
- Throws:
CcsDbException
-
delete
- Specified by:
delete
in interfaceRepositoryBaseInterface<F>
- Parameters:
query
- the where condition- Returns:
- the count of deleted items based on Query (where condition)
- Throws:
CcsDbException
-
update
- Specified by:
update
in interfaceRepositoryBaseInterface<F>
- Parameters:
query
- the where conditionupdate
- the update part- Returns:
- the count of updated items based on Query (where condition) and the Update
- Throws:
CcsDbException
-
updateFull
Description copied from interface:RepositoryBaseInterface
Update fully this E- Specified by:
updateFull
in interfaceRepositoryBaseInterface<F>
- Returns:
- True if ok
- Throws:
CcsDbException
-
insert
- Specified by:
insert
in interfaceRepositoryBaseInterface<F>
- Parameters:
item
- the item to insert- Throws:
CcsDbException
-
findQuery
Build the SELECT Hibernate Query from the DbQuery- Throws:
CcsDbException
-
getSelectQuery
Build the SELECT Hibernate Query from the DbQuery- Throws:
CcsDbException
-