public class DbConnectionImpl extends Object implements DbConnection
Modifier and Type | Method and Description |
---|---|
void |
commit() |
com.querydsl.sql.dml.SQLDeleteClause |
delete(com.querydsl.sql.RelationalPath<?> entity)
Starts an delete statement on the given DB Table.
|
Connection |
getJdbcConnection()
Returns the JDBC connection wrapped by this object.
|
IdGeneratingSQLInsertClause |
insert(JiraRelationalPathBase<?> entity)
Starts an insert statement on the given DB Table.
|
com.querydsl.sql.SQLQuery |
newSqlQuery()
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.
|
public Connection getJdbcConnection()
DbConnection
getJdbcConnection
in interface DbConnection
public com.querydsl.sql.SQLQuery newSqlQuery()
DbConnection
Example usage:
QVersion v = new QVersion("v"); final Listversions = dbConnection.newSqlQuery() .select(v) .from(v) .where(v.project.eq(projectId)) .orderBy(v.sequence.asc()) .fetch();
newSqlQuery
in interface DbConnection
public com.querydsl.sql.dml.SQLUpdateClause update(com.querydsl.sql.RelationalPath<?> entity)
DbConnection
Example usage:
dbConnection.update(QIssueLink.ISSUE_LINK) .set(QIssueLink.ISSUE_LINK.linktype, newIssueLinkTypeId) .where(QIssueLink.ISSUE_LINK.id.eq(issueLink.getId())) .execute();
update
in interface DbConnection
entity
- The DB entity you want to update eg QIssue.ISSUE
public IdGeneratingSQLInsertClause insert(JiraRelationalPathBase<?> entity)
DbConnection
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();
insert
in interface DbConnection
entity
- The DB entity you want to insert into eg QIssue.ISSUE
public com.querydsl.sql.dml.SQLDeleteClause delete(com.querydsl.sql.RelationalPath<?> entity)
DbConnection
Example usage:
dbConnection.delete(QIssueLink.ISSUE_LINK) .where(QIssueLink.ISSUE_LINK.id.eq(issueLink.getId())) .execute();
delete
in interface DbConnection
entity
- The DB entity you want to delete from eg QIssue.ISSUE
public void setAutoCommit(boolean autoCommit)
setAutoCommit
in interface DbConnection
public void commit()
commit
in interface DbConnection
public void rollback()
rollback
in interface DbConnection
Copyright © 2002-2017 Atlassian. All Rights Reserved.