Package ome.util.actions
Class PostgresSqlAction
- java.lang.Object
-
- ome.util.SqlAction.Impl
-
- ome.util.actions.PostgresSqlAction
-
- All Implemented Interfaces:
SqlAction
public class PostgresSqlAction extends SqlAction.Impl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ome.util.SqlAction
SqlAction.DeleteLog, SqlAction.IdRowMapper, SqlAction.Impl, SqlAction.LoggingSqlAction, SqlAction.StringRowMapper
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringinsertFormatSqlDeprecated.-
Fields inherited from class ome.util.SqlAction.Impl
log, MAX_IN_SIZE
-
-
Constructor Summary
Constructors Constructor Description PostgresSqlAction(org.springframework.jdbc.core.JdbcTemplate jdbc)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.springframework.jdbc.core.JdbcTemplate_jdbc()protected java.lang.String_lookup(java.lang.String key)protected org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate_namedJdbc()booleanactiveSession(java.lang.String sessionUUID)Returns whether the given string is the UUID of a session that is currently active.intcloseSessions(java.lang.String uuid)longcountFormat(java.lang.String name)voidcreateSavepoint(java.lang.String savepoint)java.util.Set<java.lang.String>currentUserNames()longcurrValue(java.lang.String segmentName)java.lang.StringdbUuid()java.lang.StringdbVersion()voiddeferConstraints()voiddelCurrentEventLog(java.lang.String key)java.lang.LongfindRepoImageFromPixels(long id)java.util.List<java.lang.Long>findRepoPixels(java.lang.String uuid, java.lang.String dirname, java.lang.String basename)java.util.List<java.lang.Long>getDeletedIds(java.lang.String entityType)java.util.List<java.lang.String>getPixelsNamePathRepo(long id)Retrieves the name, path and repo for the given pixels set.java.util.List<java.lang.Long>getShapeIds(long roiId)protected voidhandlePotentialPgArrayJarError(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).intinsertFormat(java.lang.String name)Deprecated.voidinsertLogs(java.util.List<java.lang.Object[]> batchData)intinsertSession(java.util.Map<java.lang.String,java.lang.Object> params)java.lang.LongnextSessionId()longnextValue(java.lang.String segmentValue, int incrementSize)The implementation of this method guarantees that even if the current transaction fails that the value found will not be used by another transaction.longnodeId(java.lang.String internal_uuid)java.util.Datenow()voidprepareSession(long eventId, long userId, long groupId)Stores the current event context information in a temporary table so that triggers can make use of them.voidreleaseSavepoint(java.lang.String savepoint)intremovePassword(java.lang.Long id)java.util.Map<java.lang.String,java.lang.Object>repoFile(long value)java.lang.StringrewriteHql(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.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>roiByImage(long imageId)voidrollbackSavepoint(java.lang.String savepoint)longselectCurrentEventLog(java.lang.String key)java.lang.LongsessionId(java.lang.String uuid)voidsetCurrentEventLog(long id, java.lang.String key)voidsetFileRepo(java.util.Collection<java.lang.Long> ids, java.lang.String repoId)voidsetPixelsNamePathRepo(long pixId, java.lang.String name, java.lang.String path, java.lang.String repoId)intsynchronizeJobs(java.util.List<java.lang.Long> ids)intupdateConfiguration(java.lang.String key, java.lang.String value)intupdateSessionUserIP(long sessionId, java.lang.String userIP)-
Methods inherited from class ome.util.SqlAction.Impl
addMessageWithinDbPatchEnd, addMessageWithinDbPatchStart, addMimetypes, changeGroupPermissions, changeTablePermissionsForGroup, clearPermissionsBit, closeNode, closeNodeSessions, configValue, createIdsTempTable, createInsertTrigger, delConfigValue, deleteCurrentAdminPrivileges, deleteOldAdminPrivileges, deleteRepoDeleteLogs, fileIdsInDb, fileRepo, filterFileIdsByRepo, findOldAdminPrivileges, findRepoDeleteLogs, findRepoFile, findRepoFile, findRepoFile, findRepoFilePath, findRepoFiles, findRepoFiles, findRepoRootPath, getEventLogPartitions, getEventLogPercent, getGroupIds, getGroupPermissions, getLdapExperimenters, getPasswordHash, getShareData, getUserEmailByOmeName, getUserEmailsByGroup, getUserGroups, getUserId, getUsername, getUserPrettyNameByOmeName, groupInfoFor, hasUnicodeUnits, insertCurrentAdminPrivileges, isFileInRepo, isLdapExperimenter, nextPixelsDataLogForRepo, printThrowable, refreshEventLogFromUpdatedAnnotations, repoScriptCount, scriptRepo, setPermissionsBit, setRoles, setStatsInfo, setUserPassword, updateOrInsertConfigValue
-
-
-
-
Method Detail
-
_jdbc
protected org.springframework.jdbc.core.JdbcTemplate _jdbc()
- Specified by:
_jdbcin classSqlAction.Impl
-
_namedJdbc
protected org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate _namedJdbc()
- Specified by:
_namedJdbcin classSqlAction.Impl
-
_lookup
protected java.lang.String _lookup(java.lang.String key)
- Specified by:
_lookupin classSqlAction.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:
rewriteHqlin interfaceSqlAction- Overrides:
rewriteHqlin classSqlAction.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:SqlActionStores 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:SqlActionReturns whether the given string is the UUID of a session that is currently active.- Parameters:
sessionUUID- NOT NULL.- Returns:
trueifsessionUUIDis an active session,falseotherwise
-
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()
-
selectCurrentEventLog
public long selectCurrentEventLog(java.lang.String key)
- Specified by:
selectCurrentEventLogin interfaceSqlAction- Overrides:
selectCurrentEventLogin classSqlAction.Impl
-
setCurrentEventLog
public void setCurrentEventLog(long id, java.lang.String key)- Specified by:
setCurrentEventLogin interfaceSqlAction- Overrides:
setCurrentEventLogin classSqlAction.Impl
-
delCurrentEventLog
public void delCurrentEventLog(java.lang.String key)
- Specified by:
delCurrentEventLogin interfaceSqlAction- Overrides:
delCurrentEventLogin classSqlAction.Impl
-
nextValue
public long nextValue(java.lang.String segmentValue, int incrementSize)Description copied from interface:SqlActionThe 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 InternalExceptionDescription copied from interface:SqlActionRetrieves 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
-
-