Class 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 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:
        count in interface step.core.collections.Collection<T>
      • estimatedCount

        public long estimatedCount()
        Specified by:
        estimatedCount in interface step.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:
        find in interface step.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:
        findReduced in interface step.core.collections.Collection<T>
      • distinct

        public List<String> distinct​(String columnName,
                                     step.core.collections.Filter filter)
        Specified by:
        distinct in interface step.core.collections.Collection<T>
      • remove

        public void remove​(step.core.collections.Filter filter)
        Specified by:
        remove in interface step.core.collections.Collection<T>
      • save

        public T save​(T entity)
        Specified by:
        save in interface step.core.collections.Collection<T>
      • save

        public void save​(Iterable<T> entities)
        Specified by:
        save in interface step.core.collections.Collection<T>
      • createOrUpdateIndex

        public void createOrUpdateIndex​(String field)
        Specified by:
        createOrUpdateIndex in interface step.core.collections.Collection<T>
      • createOrUpdateIndex

        public void createOrUpdateIndex​(String field,
                                        int order)
        Specified by:
        createOrUpdateIndex in interface step.core.collections.Collection<T>
      • createOrUpdateCompoundIndex

        public void createOrUpdateCompoundIndex​(String... fields)
        Specified by:
        createOrUpdateCompoundIndex in interface step.core.collections.Collection<T>
      • createOrUpdateCompoundIndex

        public void createOrUpdateCompoundIndex​(Map<String,​Integer> fields)
        Specified by:
        createOrUpdateCompoundIndex in interface step.core.collections.Collection<T>
      • getFieldClass

        protected Class getFieldClass​(String field)
      • getFieldClass

        protected Class getFieldClass​(Class clazz,
                                      String _field)
      • rename

        public void rename​(String newName)
        Specified by:
        rename in interface step.core.collections.Collection<T>
      • drop

        public void drop()
        Specified by:
        drop in interface step.core.collections.Collection<T>
      • getEntityClass

        public Class<T> getEntityClass()
        Specified by:
        getEntityClass in interface step.core.collections.Collection<T>