Package step.core.collections.postgresql
Class PostgreSQLCollection<T>
- java.lang.Object
-
- step.core.collections.AbstractCollection<T>
-
- step.core.collections.postgresql.PostgreSQLCollection<T>
-
- All Implemented Interfaces:
step.core.collections.Collection<T>
public class PostgreSQLCollection<T> extends step.core.collections.AbstractCollection<T> implements step.core.collections.Collection<T>
-
-
Constructor Summary
Constructors Constructor Description PostgreSQLCollection(com.zaxxer.hikari.HikariDataSource ds, String collectionName, Class<T> entityClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount(step.core.collections.Filter filter, Integer limit)voidcreateOrUpdateCompoundIndex(String... fields)voidcreateOrUpdateCompoundIndex(Map<String,Integer> fields)voidcreateOrUpdateIndex(String field)voidcreateOrUpdateIndex(String field, int order)List<String>distinct(String columnName, step.core.collections.Filter filter)voiddrop()longestimatedCount()Stream<T>find(step.core.collections.Filter filter, step.core.collections.SearchOrder order, Integer skip, Integer limit, int maxTime)Stream<T>findReduced(step.core.collections.Filter filter, step.core.collections.SearchOrder order, Integer skip, Integer limit, int maxTime, List<String> reduceFields)Class<T>getEntityClass()protected ClassgetFieldClass(Class clazz, String _field)protected ClassgetFieldClass(String field)voidremove(step.core.collections.Filter filter)voidrename(String newName)voidsave(Iterable<T> entities)Tsave(T entity)
-
-
-
Constructor Detail
-
PostgreSQLCollection
public PostgreSQLCollection(com.zaxxer.hikari.HikariDataSource ds, String collectionName, Class<T> entityClass) throws SQLException- Throws:
SQLException
-
-
Method Detail
-
count
public long count(step.core.collections.Filter filter, Integer limit)- Specified by:
countin interfacestep.core.collections.Collection<T>
-
estimatedCount
public long estimatedCount()
- Specified by:
estimatedCountin interfacestep.core.collections.Collection<T>
-
find
public Stream<T> find(step.core.collections.Filter filter, step.core.collections.SearchOrder order, Integer skip, Integer limit, int maxTime)
- Specified by:
findin interfacestep.core.collections.Collection<T>
-
findReduced
public Stream<T> findReduced(step.core.collections.Filter filter, step.core.collections.SearchOrder order, Integer skip, Integer limit, int maxTime, List<String> reduceFields)
- Specified by:
findReducedin interfacestep.core.collections.Collection<T>
-
distinct
public List<String> distinct(String columnName, step.core.collections.Filter filter)
- Specified by:
distinctin interfacestep.core.collections.Collection<T>
-
remove
public void remove(step.core.collections.Filter filter)
- Specified by:
removein interfacestep.core.collections.Collection<T>
-
save
public void save(Iterable<T> entities)
- Specified by:
savein interfacestep.core.collections.Collection<T>
-
createOrUpdateIndex
public void createOrUpdateIndex(String field)
- Specified by:
createOrUpdateIndexin interfacestep.core.collections.Collection<T>
-
createOrUpdateIndex
public void createOrUpdateIndex(String field, int order)
- Specified by:
createOrUpdateIndexin interfacestep.core.collections.Collection<T>
-
createOrUpdateCompoundIndex
public void createOrUpdateCompoundIndex(String... fields)
- Specified by:
createOrUpdateCompoundIndexin interfacestep.core.collections.Collection<T>
-
createOrUpdateCompoundIndex
public void createOrUpdateCompoundIndex(Map<String,Integer> fields)
- Specified by:
createOrUpdateCompoundIndexin interfacestep.core.collections.Collection<T>
-
rename
public void rename(String newName)
- Specified by:
renamein interfacestep.core.collections.Collection<T>
-
drop
public void drop()
- Specified by:
dropin interfacestep.core.collections.Collection<T>
-
-