Interface SqlStatements
-
- All Known Implementing Classes:
CommonSqlStatements,H2SqlStatements,PostgreSQLSqlStatements
public interface SqlStatementsReturns SQL statements used by the JDB artifactStore implementation. There are different implementations of this interface depending on the database being used.- Author:
- eric.wittmann@gmail.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringautoUpdateVersionForGlobalId()A statement used to update the 'version' column of the 'versions' table by globalId.List<String>databaseInitialization()A sequence of statements needed to initialize the database.List<String>databaseUpgrade(int fromVersion, int toVersion)A sequence of statements needed to upgrade the DB from one version to another.StringdbType()Gets the database type associated with these statements.StringdeleteAllArtifactRules()A statement to delete all rules for a all artifacts.StringdeleteAllArtifacts()A statement to delete a all artifacts.StringdeleteAllContent()A statement to delete all content owned by a tenantIdStringdeleteAllGroups()A statement used to delete all rows from the groups table.StringdeleteAllLabels()A statement to delete all labels for all versions for all artifactsStringdeleteAllOrphanedContent()A statement to delete content that is no longer being referenced by an artifact version.StringdeleteAllProperties()A statement to delete all properties for all versions for all artifactsStringdeleteAllRoleMappings()StringdeleteAllVersions()A statement to delete all versions for all artifacts.StringdeleteArtifact()A statement to delete a single row from the artifacts table by artifactId.StringdeleteArtifactRule()A statement to delete a single artifact rule.StringdeleteArtifactRules()A statement to delete all rules for a single artifact.StringdeleteArtifactRulesByGroupId()A statement to delete all rules for all artifacts in a groupId.StringdeleteArtifactsByGroupId()A statement to delete a all artifacts from the artifacts table by groupId.StringdeleteDownload()StringdeleteExpiredDownloads()StringdeleteGlobalRule()A statement used to delete a row from the globalrules table.StringdeleteGlobalRules()A statement used to delete all rows in the globalrules table.StringdeleteGroup()A statement used to delete a row from the groups table.StringdeleteLabels()A statement to delete all labels for all versions for a single artifact.StringdeleteLabelsByGlobalId()A statement to delete all labels for a single artifact version by globalIdStringdeleteLabelsByGroupId()A statement to delete all labels for all versions for all artifacts in a groupId.StringdeleteLogConfiguration()A statement to delete a row in the "logconfiguration" tableStringdeleteProperties()A statement to delete all properties for all versions for a single artifact.StringdeletePropertiesByGlobalId()A statement to delete all properties for a single artifact version by globalIdStringdeletePropertiesByGroupId()A statement to delete all properties for all versions for all artifacts in a groupId.StringdeleteRoleMapping()StringdeleteVersion()A statement to delete a single artifact version.StringdeleteVersionLabels()A statement to delete the labels for a single artifact version.StringdeleteVersionProperties()A statement to delete the properties for a single artifact version.StringdeleteVersions()A statement to delete all versions for a single artifact.StringdeleteVersionsByGroupId()A statement to delete all versions for all artifacts in a groupId.StringexportArtifactRules()StringexportArtifactVersions()StringexportContent()StringexportGlobalRules()StringexportGroups()StringgetDatabaseVersion()A statement that returns the current DB version (pulled from the "apicurio" attribute table).StringgetNextSequenceValue()StringimportArtifactRule()StringimportArtifactVersion()StringimportContent()StringimportGlobalRule()StringimportGroup()StringinsertArtifact()A statement used to insert a row in the artifacts table.StringinsertArtifactRule()A statement to insert a row into the 'rules' table (artifact rule).StringinsertDownload()StringinsertGlobalRule()A statement used to insert a row into the globalrules table.StringinsertGroup()A statement used to insert a row into the groups table.StringinsertLabel()A statement to insert a row in the "labels" table.StringinsertProperty()A statement to insert a row in the "properties" table.StringinsertRoleMapping()StringinsertSequenceValue()StringinsertVersion(boolean firstVersion)A statement used to insert a row in the versions table.StringisDatabaseInitialized()A statement that returns 'true' if the database has already been initialized.booleanisForeignKeyViolation(Exception error)Returns true if the given exception represents a foreign key violation.booleanisPrimaryKeyViolation(Exception error)Returns true if the given exception represents a primary key violation.StringresetSequenceValue()StringselectAllArtifactCount()A statement used to count the total # of artifacts.StringselectAllArtifactVersions()A statement used to select all versions for a given artifactId.StringselectAllArtifactVersionsCount()A statement used to count the total # of versions for an artifact.StringselectAllLogConfigurations()A statement to select all rows in the "logconfiguration" tableStringselectArtifactCountById()A statement to select the number of artifacts with a given artifactId (should be 0 or 1).StringselectArtifactIds()A statement to get all artifacts IDs.StringselectArtifactMetaDataByGlobalId()A statement to get an artifact's meta-data by version globalId.StringselectArtifactRuleByType()A statement to get a single artifact rule from the 'rules' table by artifactId and rule type.StringselectArtifactRuleCountByType()A statement to select the number of artifact rule rows for a given rule type.StringselectArtifactRules()A statement used to select artifact rules by artifactId.StringselectArtifactVersionContent()A statement to select the content of an artifact version from the versions table by artifactId + version.StringselectArtifactVersionContentByGlobalId()A statement to select the content of an artifact version from the versions table by globalId.StringselectArtifactVersionMetaData()A statement used to select artifact version metadata by artifactId and version.StringselectArtifactVersionMetaDataByCanonicalHash()A statement used to select a single row in the versions by artifactId and canonical content hash.StringselectArtifactVersionMetaDataByContentHash()A statement used to select a single row in the versions by artifactId and content hash.StringselectArtifactVersionMetaDataByContentId()A statement used to select a single row in the versions by artifactId and content id.StringselectArtifactVersionMetaDataByGlobalId()A statement used to select a single row in the versions table by globalId.StringselectArtifactVersions()A statement used to select all version #s for a given artifactId.StringselectContentByContentHash()A statement to select the bytes of a content row by contentHashStringselectContentById()A statement to select the bytes of a content row by contentId.StringselectContentCountByHash()A statement to select the number of content rows for a given content hash.StringselectContentExists()StringselectContentIdByHash()A statement to select the contentId of a row in the content table by hash value.StringselectCurrentSequenceValue()StringselectDownloadContext()StringselectGlobalIdExists()StringselectGlobalRuleByType()A statement used to select a single global rule by its type/id.StringselectGlobalRuleCountByType()A statement to select the number of global rule rows for a given rule type.StringselectGlobalRules()A statement used to select all global rules.StringselectGroupByGroupId()A statement used to select a single group in groups table by groupId.StringselectGroups()A statement used to select all rows from groups table.StringselectLatestArtifactContent()A statement to get a single artifact (latest version) content by artifactId.StringselectLatestArtifactMetaData()A statement to get a single artifact (latest version) meta-data by artifactId.StringselectLogConfigurationByLogger()A statement to select the log configuration for a given logger nameStringselectMaxContentId()StringselectMaxGlobalId()StringselectRoleByPrincipalId()StringselectRoleMappingByPrincipalId()StringselectRoleMappingCountByPrincipal()StringselectRoleMappings()StringselectTotalArtifactVersionsCount()A statement used to count the total # of versions for all artifact.StringupdateArtifactLatest()A statement used to update the 'latest' column of the 'artifacts' table.StringupdateArtifactLatestGlobalId()A statement used to update the 'latest' column of the 'artifacts' table to the globalId of the highest remaining version.StringupdateArtifactRule()A statement to update a single artifact rule.StringupdateArtifactVersionMetaData()A statement to update the meta-data of a specific artifact version.StringupdateArtifactVersionState()A statement to update the state of an artifact version (by globalId);StringupdateContentCanonicalHash()A statement to update canonicalHash value in a row in the "content" table The only statement that allows to modify an existing row in the "content" tableStringupdateGlobalRule()A statement used to update information about a global rule.StringupdateGroup()A statement used to update information about a group.StringupdateRoleMapping()StringupsertContent()A statement to "upsert" a row in the "content" table.StringupsertLogConfiguration()A statement to "upsert" a row in the "logconfiguration" table
-
-
-
Method Detail
-
dbType
String dbType()
Gets the database type associated with these statements.
-
isPrimaryKeyViolation
boolean isPrimaryKeyViolation(Exception error)
Returns true if the given exception represents a primary key violation.- Parameters:
error-
-
isForeignKeyViolation
boolean isForeignKeyViolation(Exception error)
Returns true if the given exception represents a foreign key violation.- Parameters:
error-
-
isDatabaseInitialized
String isDatabaseInitialized()
A statement that returns 'true' if the database has already been initialized.
-
databaseInitialization
List<String> databaseInitialization()
A sequence of statements needed to initialize the database.
-
databaseUpgrade
List<String> databaseUpgrade(int fromVersion, int toVersion)
A sequence of statements needed to upgrade the DB from one version to another.- Parameters:
fromVersion-toVersion-
-
getDatabaseVersion
String getDatabaseVersion()
A statement that returns the current DB version (pulled from the "apicurio" attribute table).
-
insertGlobalRule
String insertGlobalRule()
A statement used to insert a row into the globalrules table.
-
selectGlobalRules
String selectGlobalRules()
A statement used to select all global rules.
-
selectGlobalRuleByType
String selectGlobalRuleByType()
A statement used to select a single global rule by its type/id.
-
deleteGlobalRule
String deleteGlobalRule()
A statement used to delete a row from the globalrules table.
-
deleteGlobalRules
String deleteGlobalRules()
A statement used to delete all rows in the globalrules table.
-
updateGlobalRule
String updateGlobalRule()
A statement used to update information about a global rule.
-
insertArtifact
String insertArtifact()
A statement used to insert a row in the artifacts table.
-
updateArtifactLatest
String updateArtifactLatest()
A statement used to update the 'latest' column of the 'artifacts' table.
-
updateArtifactLatestGlobalId
String updateArtifactLatestGlobalId()
A statement used to update the 'latest' column of the 'artifacts' table to the globalId of the highest remaining version.
-
autoUpdateVersionForGlobalId
String autoUpdateVersionForGlobalId()
A statement used to update the 'version' column of the 'versions' table by globalId. The value of the "versionId" column is copied into the "version" column.
-
insertVersion
String insertVersion(boolean firstVersion)
A statement used to insert a row in the versions table.
-
selectArtifactVersionMetaDataByGlobalId
String selectArtifactVersionMetaDataByGlobalId()
A statement used to select a single row in the versions table by globalId.
-
selectArtifactVersionMetaDataByContentHash
String selectArtifactVersionMetaDataByContentHash()
A statement used to select a single row in the versions by artifactId and content hash.
-
selectArtifactVersionMetaDataByContentId
String selectArtifactVersionMetaDataByContentId()
A statement used to select a single row in the versions by artifactId and content id.
-
selectArtifactVersionMetaDataByCanonicalHash
String selectArtifactVersionMetaDataByCanonicalHash()
A statement used to select a single row in the versions by artifactId and canonical content hash.
-
selectArtifactVersionContentByGlobalId
String selectArtifactVersionContentByGlobalId()
A statement to select the content of an artifact version from the versions table by globalId.
-
selectArtifactVersions
String selectArtifactVersions()
A statement used to select all version #s for a given artifactId.
-
selectAllArtifactVersions
String selectAllArtifactVersions()
A statement used to select all versions for a given artifactId.
-
selectAllArtifactCount
String selectAllArtifactCount()
A statement used to count the total # of artifacts.
-
selectAllArtifactVersionsCount
String selectAllArtifactVersionsCount()
A statement used to count the total # of versions for an artifact.
-
selectTotalArtifactVersionsCount
String selectTotalArtifactVersionsCount()
A statement used to count the total # of versions for all artifact.
-
selectArtifactVersionMetaData
String selectArtifactVersionMetaData()
A statement used to select artifact version metadata by artifactId and version.
-
selectArtifactVersionContent
String selectArtifactVersionContent()
A statement to select the content of an artifact version from the versions table by artifactId + version.
-
upsertContent
String upsertContent()
A statement to "upsert" a row in the "content" table.
-
updateContentCanonicalHash
String updateContentCanonicalHash()
A statement to update canonicalHash value in a row in the "content" table The only statement that allows to modify an existing row in the "content" table
-
selectLatestArtifactContent
String selectLatestArtifactContent()
A statement to get a single artifact (latest version) content by artifactId.
-
selectLatestArtifactMetaData
String selectLatestArtifactMetaData()
A statement to get a single artifact (latest version) meta-data by artifactId.
-
selectContentIdByHash
String selectContentIdByHash()
A statement to select the contentId of a row in the content table by hash value.
-
selectArtifactRules
String selectArtifactRules()
A statement used to select artifact rules by artifactId.
-
insertArtifactRule
String insertArtifactRule()
A statement to insert a row into the 'rules' table (artifact rule).
-
selectArtifactRuleByType
String selectArtifactRuleByType()
A statement to get a single artifact rule from the 'rules' table by artifactId and rule type.
-
updateArtifactRule
String updateArtifactRule()
A statement to update a single artifact rule.
-
deleteArtifactRule
String deleteArtifactRule()
A statement to delete a single artifact rule.
-
deleteArtifactRules
String deleteArtifactRules()
A statement to delete all rules for a single artifact.
-
deleteAllArtifactRules
String deleteAllArtifactRules()
A statement to delete all rules for a all artifacts.
-
deleteArtifactRulesByGroupId
String deleteArtifactRulesByGroupId()
A statement to delete all rules for all artifacts in a groupId.
-
updateArtifactVersionMetaData
String updateArtifactVersionMetaData()
A statement to update the meta-data of a specific artifact version.
-
deleteLabels
String deleteLabels()
A statement to delete all labels for all versions for a single artifact.
-
deleteLabelsByGlobalId
String deleteLabelsByGlobalId()
A statement to delete all labels for a single artifact version by globalId
-
deleteLabelsByGroupId
String deleteLabelsByGroupId()
A statement to delete all labels for all versions for all artifacts in a groupId.
-
deleteAllLabels
String deleteAllLabels()
A statement to delete all labels for all versions for all artifacts
-
deleteProperties
String deleteProperties()
A statement to delete all properties for all versions for a single artifact.
-
deletePropertiesByGlobalId
String deletePropertiesByGlobalId()
A statement to delete all properties for a single artifact version by globalId
-
deletePropertiesByGroupId
String deletePropertiesByGroupId()
A statement to delete all properties for all versions for all artifacts in a groupId.
-
deleteAllProperties
String deleteAllProperties()
A statement to delete all properties for all versions for all artifacts
-
deleteVersions
String deleteVersions()
A statement to delete all versions for a single artifact.
-
deleteVersionsByGroupId
String deleteVersionsByGroupId()
A statement to delete all versions for all artifacts in a groupId.
-
deleteAllVersions
String deleteAllVersions()
A statement to delete all versions for all artifacts.
-
deleteArtifact
String deleteArtifact()
A statement to delete a single row from the artifacts table by artifactId.
-
deleteArtifactsByGroupId
String deleteArtifactsByGroupId()
A statement to delete a all artifacts from the artifacts table by groupId.
-
deleteAllArtifacts
String deleteAllArtifacts()
A statement to delete a all artifacts.
-
selectArtifactIds
String selectArtifactIds()
A statement to get all artifacts IDs.
-
selectArtifactMetaDataByGlobalId
String selectArtifactMetaDataByGlobalId()
A statement to get an artifact's meta-data by version globalId.
-
updateArtifactVersionState
String updateArtifactVersionState()
A statement to update the state of an artifact version (by globalId);
-
deleteVersionLabels
String deleteVersionLabels()
A statement to delete the labels for a single artifact version.
-
deleteVersionProperties
String deleteVersionProperties()
A statement to delete the properties for a single artifact version.
-
deleteVersion
String deleteVersion()
A statement to delete a single artifact version.
-
insertLabel
String insertLabel()
A statement to insert a row in the "labels" table.
-
insertProperty
String insertProperty()
A statement to insert a row in the "properties" table.
-
selectArtifactCountById
String selectArtifactCountById()
A statement to select the number of artifacts with a given artifactId (should be 0 or 1).
-
selectContentCountByHash
String selectContentCountByHash()
A statement to select the number of content rows for a given content hash.
-
selectArtifactRuleCountByType
String selectArtifactRuleCountByType()
A statement to select the number of artifact rule rows for a given rule type.
-
selectGlobalRuleCountByType
String selectGlobalRuleCountByType()
A statement to select the number of global rule rows for a given rule type.
-
selectContentById
String selectContentById()
A statement to select the bytes of a content row by contentId.
-
selectContentByContentHash
String selectContentByContentHash()
A statement to select the bytes of a content row by contentHash
-
deleteAllOrphanedContent
String deleteAllOrphanedContent()
A statement to delete content that is no longer being referenced by an artifact version.
-
deleteAllContent
String deleteAllContent()
A statement to delete all content owned by a tenantId
-
selectLogConfigurationByLogger
String selectLogConfigurationByLogger()
A statement to select the log configuration for a given logger name
-
upsertLogConfiguration
String upsertLogConfiguration()
A statement to "upsert" a row in the "logconfiguration" table
-
deleteLogConfiguration
String deleteLogConfiguration()
A statement to delete a row in the "logconfiguration" table
-
selectAllLogConfigurations
String selectAllLogConfigurations()
A statement to select all rows in the "logconfiguration" table
-
insertGroup
String insertGroup()
A statement used to insert a row into the groups table.
-
updateGroup
String updateGroup()
A statement used to update information about a group.
-
deleteGroup
String deleteGroup()
A statement used to delete a row from the groups table.
-
deleteAllGroups
String deleteAllGroups()
A statement used to delete all rows from the groups table.
-
selectGroups
String selectGroups()
A statement used to select all rows from groups table.
-
selectGroupByGroupId
String selectGroupByGroupId()
A statement used to select a single group in groups table by groupId.
-
getNextSequenceValue
String getNextSequenceValue()
-
selectCurrentSequenceValue
String selectCurrentSequenceValue()
-
resetSequenceValue
String resetSequenceValue()
-
insertSequenceValue
String insertSequenceValue()
-
exportContent
String exportContent()
-
exportGlobalRules
String exportGlobalRules()
-
exportGroups
String exportGroups()
-
exportArtifactRules
String exportArtifactRules()
-
exportArtifactVersions
String exportArtifactVersions()
-
importContent
String importContent()
-
importGlobalRule
String importGlobalRule()
-
importGroup
String importGroup()
-
importArtifactRule
String importArtifactRule()
-
importArtifactVersion
String importArtifactVersion()
-
selectMaxContentId
String selectMaxContentId()
-
selectMaxGlobalId
String selectMaxGlobalId()
-
selectContentExists
String selectContentExists()
-
selectGlobalIdExists
String selectGlobalIdExists()
-
insertRoleMapping
String insertRoleMapping()
-
deleteRoleMapping
String deleteRoleMapping()
-
deleteAllRoleMappings
String deleteAllRoleMappings()
-
selectRoleMappingByPrincipalId
String selectRoleMappingByPrincipalId()
-
selectRoleByPrincipalId
String selectRoleByPrincipalId()
-
selectRoleMappings
String selectRoleMappings()
-
updateRoleMapping
String updateRoleMapping()
-
selectRoleMappingCountByPrincipal
String selectRoleMappingCountByPrincipal()
-
insertDownload
String insertDownload()
-
selectDownloadContext
String selectDownloadContext()
-
deleteDownload
String deleteDownload()
-
deleteExpiredDownloads
String deleteExpiredDownloads()
-
-