Class PostgresqlQueryHandlerImpl

    • Constructor Detail

      • PostgresqlQueryHandlerImpl

        public PostgresqlQueryHandlerImpl()
    • Method Detail

      • from

        public static com.querydsl.sql.SQLQuery<?> from​(Connection connection,
                                                        com.querydsl.sql.RelationalPathBase<?>... from)
      • query

        public static com.querydsl.sql.SQLQuery<?> query()
      • query

        public static com.querydsl.sql.SQLQuery<?> query​(Connection connection)
      • closeAccountBalances

        public long closeAccountBalances()
        Description copied from interface: NativeQueryHandler
        Closes the account balances, returning the number of balances closed
      • copyLargeObject

        public long copyLargeObject​(long sourceOid)
                             throws IOException
        Description copied from interface: NativeQueryHandler
        Makes a copy of the large object with the specified oid and returns the oid of the copy.
        Throws:
        IOException
      • countUsersByUrl

        public List<Pair<String,​Long>> countUsersByUrl()
        Description copied from interface: NativeQueryHandler
        Groups all non removed nor purged members and brokers (not admins) by each root URL defined in the configurations.
        Returns:
      • deleteLargeObject

        public void deleteLargeObject​(long oid)
        Description copied from interface: NativeQueryHandler
        Deletes the large object with the specified oid.
      • destroy

        @PreDestroy
        public void destroy()
      • fixInconsistentAccountBalances

        public List<InconsistentBalance> fixInconsistentAccountBalances​(List<Long> accountIds)
        Description copied from interface: NativeQueryHandler
        Fixes any wrong account balances, returning the account ids that were wrong
      • getAccountBalanceHistory

        public List<BalanceEntryVO> getAccountBalanceHistory​(Long accountId,
                                                             List<Date> timepoints)
        Description copied from interface: NativeQueryHandler
        Returns the account balance on each of the given timepoints, plus the current status as the last result
      • getJpaQueryTemplates

        public com.querydsl.jpa.JPQLTemplates getJpaQueryTemplates()
        Description copied from interface: NativeQueryHandler
        Returns the templates used for jpa queries
      • getNextTransactionNumber

        public Long getNextTransactionNumber()
        Description copied from interface: NativeQueryHandler
        Returns the number used to generate the next transaction number
      • getObjectId

        public Long getObjectId​(long soredFileId)
        Description copied from interface: NativeQueryHandler
        Returns the oid associated to the specified stored file id. Returns null if the stored file doesn't have any associated content.
      • getRunningVacuumStart

        public Date getRunningVacuumStart()
        Description copied from interface: NativeQueryHandler
        Returns the date when the vacuum started if there is a running vacuum. Otherwise it returns null.
      • getSearchHandler

        public SearchHandler getSearchHandler()
        Description copied from interface: NativeQueryHandler
        Returns a handler to search on the database
      • insert

        public com.querydsl.sql.dml.SQLInsertClause insert​(Connection connection,
                                                           com.querydsl.sql.RelationalPath<?> alias)
      • insertBackgroundTaskExecution

        public long insertBackgroundTaskExecution​(BaseBackgroundTaskScheduling<?> scheduling)
        Description copied from interface: NativeQueryHandler
        Insert or updates a background task execution for the given type and context. Returns the id of the created / updated background task execution.
      • insertTransferInitialStatus

        public void insertTransferInitialStatus​(TransferType transferType,
                                                TransferStatus status)
        Description copied from interface: NativeQueryHandler
        Inserts the relation for current status and a log for each transfer of the given type
      • insertUserAccountFeeLogs

        public long insertUserAccountFeeLogs​(AccountFeeLog log)
        Description copied from interface: NativeQueryHandler
        Inserts into the users_account_fee_logs table, for each users that should be charged (has a product that enables the given fee)
      • insertUsersForBulkAction

        public long insertUsersForBulkAction​(Long bulkActionId,
                                             UserQuery params)
        Description copied from interface: NativeQueryHandler
        Inserts a record of BulkActionUser for each returned user of the given query
      • iterateRecords

        public com.mysema.commons.lang.CloseableIterator<Record> iterateRecords​(RecordQuery params)
        Description copied from interface: NativeQueryHandler
        Iterates record entities according to the given query parameters
      • iterateUserIds

        public com.mysema.commons.lang.CloseableIterator<Long> iterateUserIds​(UserQuery params)
        Description copied from interface: NativeQueryHandler
        Iterates user ids according to the given query parameters
      • iterateUsers

        public com.mysema.commons.lang.CloseableIterator<UserWithFieldsVO> iterateUsers​(UserQuery params)
        Description copied from interface: NativeQueryHandler
        Iterates user entities according to the given query parameters
      • nextAccountIdsToClose

        public List<Long> nextAccountIdsToClose​(int maxCount,
                                                Date limit)
        Description copied from interface: NativeQueryHandler
        Returns up to the maximum count of account ids to close balance. Accounts that are returned:
        1. Accounts that have never been closed yet
        2. Accounts whose last closing was before the given limit and the current account balance's date is newer than the last closing
      • openLargeObject

        public InputStream openLargeObject​(long oid)
        Description copied from interface: NativeQueryHandler
        Opens the large object associated to the specified oid.
        NOTE: After read, the input stream must be closed (the large object will be closed in turn).
      • purgeRemovedBuiltinLanguages

        public Pair<Set<String>,​Set<Long>> purgeRemovedBuiltinLanguages()
        Description copied from interface: NativeQueryHandler
        Removes all languages that were pointing to BuiltinLanguages that no longer exist, returning both the language templates that no longer exist and the ids of languages that were removed
      • rebuildClosedAccountBalances

        public long rebuildClosedAccountBalances()
        Description copied from interface: NativeQueryHandler
        Rebuilds all closed account balances from the beginning
      • setObjectId

        public void setObjectId​(long storedFileId,
                                long oid)
        Description copied from interface: NativeQueryHandler
        Sets the oid to the specified stored file id.
      • supportsBlobsInReadOnlyTransactions

        public boolean supportsBlobsInReadOnlyTransactions()
        Description copied from interface: NativeQueryHandler
        Returns whether the underlying database supports accessing BLOBs from pure read-only transactions
      • tryLock

        public boolean tryLock​(LockKey key)
        Description copied from interface: NativeQueryHandler
        Attempt to acquire an exclusive lock with a given key. The lock will be bound to the current transaction, and will be automatically unlocked when the transaction ends.
      • update

        public com.querydsl.sql.dml.SQLUpdateClause update​(Connection connection,
                                                           com.querydsl.sql.RelationalPath<?> alias)
      • userAccounts

        public Map<UserAccountType,​IUserAccount> userAccounts​(User user,
                                                                    Collection<UserAccountType> accountTypes,
                                                                    boolean withNumberOnly,
                                                                    Integer limit)
        Description copied from interface: NativeQueryHandler
        Returns either all accounts (when accountType is null / empty) or filtered by type, both physical and pending user accounts, for a specific user. May also only return accounts with numbers, and optionally limits the number of results. IMPORTANT: the entities contained in the resulting map are not attached to the persisted context, be aware if you need to modify some of them.
      • vacuum

        public void vacuum()
        Description copied from interface: NativeQueryHandler
        Performs a vacuum and then an analyze for the database.
      • writeLargeObject

        public long writeLargeObject​(InputStream in)
                              throws IOException
        Description copied from interface: NativeQueryHandler
        Creates a new large object reading the content from the stream and returns its oid.
        NOTE: The input stream parameter won't be closed it is responsibility of the client code.
        Throws:
        IOException