Package com.atlassian.jira.database
Class DbConnectionImpl
java.lang.Object
com.atlassian.jira.database.DbConnectionImpl
- All Implemented Interfaces:
DbConnection
- Since:
- v6.4
-
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
com.querydsl.sql.dml.SQLDeleteClause
delete
(com.querydsl.sql.RelationalPath<?> entity) Starts an delete statement on the given DB Table.Returns the JDBC connection wrapped by this object.insert
(JiraRelationalPathBase<?> entity) Starts an insert statement on the given DB Table.com.querydsl.sql.SQLQuery
Starts a SELECT statement on this connection.void
rollback()
void
setAutoCommit
(boolean autoCommit) com.querydsl.sql.dml.SQLUpdateClause
update
(com.querydsl.sql.RelationalPath<?> entity) Starts an update statement on the given DB Table.
-
Method Details
-
getJdbcConnection
Description copied from interface:DbConnection
Returns the JDBC connection wrapped by this object.- Specified by:
getJdbcConnection
in interfaceDbConnection
- Returns:
- the JDBC connection wrapped by this object.
-
newSqlQuery
public com.querydsl.sql.SQLQuery newSqlQuery()Description copied from interface:DbConnection
Starts a SELECT statement on this connection.Example usage:
QVersion v = new QVersion("v"); final List
versions = dbConnection.newSqlQuery() .select(v) .from(v) .where(v.project.eq(projectId)) .orderBy(v.sequence.asc()) .fetch(); - Specified by:
newSqlQuery
in interfaceDbConnection
- Returns:
- the new Query builder.
-
update
public com.querydsl.sql.dml.SQLUpdateClause update(com.querydsl.sql.RelationalPath<?> entity) Description copied from interface:DbConnection
Starts an update statement on the given DB Table.Example usage:
dbConnection.update(QIssueLink.ISSUE_LINK) .set(QIssueLink.ISSUE_LINK.linktype, newIssueLinkTypeId) .where(QIssueLink.ISSUE_LINK.id.eq(issueLink.getId())) .execute();
- Specified by:
update
in interfaceDbConnection
- Parameters:
entity
- The DB entity you want to update egQIssue.ISSUE
- Returns:
- a builder to create your update statement.
-
insert
Description copied from interface:DbConnection
Starts an insert statement on the given DB Table.Example 1 usage:
dbConnection.insert(QIssueLink.ISSUE_LINK) .set(QIssueLink.ISSUE_LINK.linktype, newIssueLinkTypeId) .set(QIssueLink.ISSUE_LINK.sequence, sequence) .execute();
Example 2 usage:
dbConnection.insert(QIssueLink.ISSUE_LINK) .populate(issueLinkDTO) .execute();
- Specified by:
insert
in interfaceDbConnection
- Parameters:
entity
- The DB entity you want to insert into egQIssue.ISSUE
- Returns:
- a builder to create your insert statement.
-
delete
public com.querydsl.sql.dml.SQLDeleteClause delete(com.querydsl.sql.RelationalPath<?> entity) Description copied from interface:DbConnection
Starts an delete statement on the given DB Table.Example usage:
dbConnection.delete(QIssueLink.ISSUE_LINK) .where(QIssueLink.ISSUE_LINK.id.eq(issueLink.getId())) .execute();
- Specified by:
delete
in interfaceDbConnection
- Parameters:
entity
- The DB entity you want to delete from egQIssue.ISSUE
- Returns:
- a builder to create your delete statement.
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) - Specified by:
setAutoCommit
in interfaceDbConnection
-
commit
public void commit()- Specified by:
commit
in interfaceDbConnection
-
rollback
public void rollback()- Specified by:
rollback
in interfaceDbConnection
-