Class PostgresSqlAction

    • Field Detail

      • insertFormatSql

        @Deprecated
        public static final java.lang.String insertFormatSql
        Deprecated.
    • Constructor Detail

      • PostgresSqlAction

        public PostgresSqlAction​(org.springframework.jdbc.core.JdbcTemplate jdbc)
    • Method Detail

      • _jdbc

        protected org.springframework.jdbc.core.JdbcTemplate _jdbc()
        Specified by:
        _jdbc in class SqlAction.Impl
      • _namedJdbc

        protected org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate _namedJdbc()
        Specified by:
        _namedJdbc in class SqlAction.Impl
      • _lookup

        protected java.lang.String _lookup​(java.lang.String key)
        Specified by:
        _lookup in class SqlAction.Impl
      • rewriteHql

        public java.lang.String rewriteHql​(java.lang.String query,
                                           java.lang.String key,
                                           java.lang.Object value)
        The temp_ids infrastructure was never properly put in place for the "psql" profile. This method simply bypasses all query rewriting until that's functional.
        Specified by:
        rewriteHql in interface SqlAction
        Overrides:
        rewriteHql in class SqlAction.Impl
        Parameters:
        query - String query (non-null) which is in effect.
        key - Key of the argument e.g. (:ids)
        value - value which has been passed in for that parameter.
        Returns:
        Returns a query replacement.
        See Also:
        ticket 3961, ticket 9077
      • prepareSession

        public void prepareSession​(long eventId,
                                   long userId,
                                   long groupId)
        Description copied from interface: SqlAction
        Stores the current event context information in a temporary table so that triggers can make use of them.
      • activeSession

        public boolean activeSession​(java.lang.String sessionUUID)
        Description copied from interface: SqlAction
        Returns whether the given string is the UUID of a session that is currently active.
        Parameters:
        sessionUUID - NOT NULL.
        Returns:
        true if sessionUUID is an active session, false otherwise
      • synchronizeJobs

        public int synchronizeJobs​(java.util.List<java.lang.Long> ids)
      • findRepoPixels

        public java.util.List<java.lang.Long> findRepoPixels​(java.lang.String uuid,
                                                             java.lang.String dirname,
                                                             java.lang.String basename)
      • findRepoImageFromPixels

        public java.lang.Long findRepoImageFromPixels​(long id)
      • nextSessionId

        public java.lang.Long nextSessionId()
      • repoFile

        public java.util.Map<java.lang.String,​java.lang.Object> repoFile​(long value)
      • countFormat

        public long countFormat​(java.lang.String name)
      • insertFormat

        @Deprecated
        public int insertFormat​(java.lang.String name)
        Deprecated.
      • closeSessions

        public int closeSessions​(java.lang.String uuid)
      • nodeId

        public long nodeId​(java.lang.String internal_uuid)
      • insertSession

        public int insertSession​(java.util.Map<java.lang.String,​java.lang.Object> params)
      • updateSessionUserIP

        public int updateSessionUserIP​(long sessionId,
                                       java.lang.String userIP)
      • sessionId

        public java.lang.Long sessionId​(java.lang.String uuid)
      • removePassword

        public int removePassword​(java.lang.Long id)
      • now

        public java.util.Date now()
      • updateConfiguration

        public int updateConfiguration​(java.lang.String key,
                                       java.lang.String value)
      • dbVersion

        public java.lang.String dbVersion()
      • dbUuid

        public java.lang.String dbUuid()
      • nextValue

        public long nextValue​(java.lang.String segmentValue,
                              int incrementSize)
        Description copied from interface: SqlAction
        The implementation of this method guarantees that even if the current transaction fails that the value found will not be used by another transaction. Database implementations can choose whether to do this at the procedure level or by using transaction PROPAGATION settings in Java.
        See Also:
        ticket 3697, ticket 3253
      • currValue

        public long currValue​(java.lang.String segmentName)
      • insertLogs

        public void insertLogs​(java.util.List<java.lang.Object[]> batchData)
      • roiByImage

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> roiByImage​(long imageId)
      • getShapeIds

        public java.util.List<java.lang.Long> getShapeIds​(long roiId)
      • setFileRepo

        public void setFileRepo​(java.util.Collection<java.lang.Long> ids,
                                java.lang.String repoId)
      • setPixelsNamePathRepo

        public void setPixelsNamePathRepo​(long pixId,
                                          java.lang.String name,
                                          java.lang.String path,
                                          java.lang.String repoId)
      • getDeletedIds

        public java.util.List<java.lang.Long> getDeletedIds​(java.lang.String entityType)
      • createSavepoint

        public void createSavepoint​(java.lang.String savepoint)
      • releaseSavepoint

        public void releaseSavepoint​(java.lang.String savepoint)
      • rollbackSavepoint

        public void rollbackSavepoint​(java.lang.String savepoint)
      • deferConstraints

        public void deferConstraints()
      • currentUserNames

        public java.util.Set<java.lang.String> currentUserNames()
      • getPixelsNamePathRepo

        public java.util.List<java.lang.String> getPixelsNamePathRepo​(long id)
                                                               throws InternalException
        Description copied from interface: SqlAction
        Retrieves the name, path and repo for the given pixels set. If the id is not found, null is returned.
        Throws:
        InternalException
      • handlePotentialPgArrayJarError

        protected void handlePotentialPgArrayJarError​(org.springframework.jdbc.UncategorizedSQLException e)
        If postgresql is installed with an older jdbc jar that is on the bootstrap classpath, then it's possible that the use of pgarrays will fail (I think). See #7432