public class

IdGeneratingSQLInsertClause

extends SQLInsertClause
java.lang.Object
   ↳ com.mysema.query.sql.dml.AbstractSQLClause<C extends com.mysema.query.sql.dml.AbstractSQLClause<C>>
     ↳ com.mysema.query.sql.dml.SQLInsertClause
       ↳ com.atlassian.jira.database.IdGeneratingSQLInsertClause

Class Overview

Extended SQLInsertClause supporting Generation of OfBiz sequence values.

Summary

[Expand]
Inherited Fields
From class com.mysema.query.sql.dml.AbstractSQLClause
Public Constructors
IdGeneratingSQLInsertClause(Connection con, SQLTemplates dialect, JiraRelationalPathBase entity, DelegatorInterface delegatorInterface)
Public Methods
IdGeneratingSQLInsertClause addFlag(QueryFlag.Position position, Expression<?> flag)
IdGeneratingSQLInsertClause addFlag(QueryFlag.Position position, String flag)
IdGeneratingSQLInsertClause columns(Path...<?> columns)
Long executeWithId()
Add an automatically generated "ID" column value to the insert statement and execute it.
IdGeneratingSQLInsertClause populate(Object bean)
<T> IdGeneratingSQLInsertClause populate(T obj, Mapper<T> mapper)
IdGeneratingSQLInsertClause select(SubQueryExpression<?> sq)
<T> IdGeneratingSQLInsertClause set(Path<T> path, T value)
<T> IdGeneratingSQLInsertClause set(Path<T> path, Expression<? extends T> expression)
<T> IdGeneratingSQLInsertClause setNull(Path<T> path)
IdGeneratingSQLInsertClause values(Object... v)
IdGeneratingSQLInsertClause withId()
Add an automatically generated "ID" column value to the insert statement.
[Expand]
Inherited Methods
From class com.mysema.query.sql.dml.SQLInsertClause
From class com.mysema.query.sql.dml.AbstractSQLClause
From class java.lang.Object
From interface com.mysema.query.dml.DMLClause
From interface com.mysema.query.dml.InsertClause
From interface com.mysema.query.dml.StoreClause

Public Constructors

public IdGeneratingSQLInsertClause (Connection con, SQLTemplates dialect, JiraRelationalPathBase entity, DelegatorInterface delegatorInterface)

Public Methods

public IdGeneratingSQLInsertClause addFlag (QueryFlag.Position position, Expression<?> flag)

public IdGeneratingSQLInsertClause addFlag (QueryFlag.Position position, String flag)

public IdGeneratingSQLInsertClause columns (Path...<?> columns)

public Long executeWithId ()

Add an automatically generated "ID" column value to the insert statement and execute it.

This method uses the Ofbiz sequence generator to generate an Id for the relation being inserted.

Example Usage:

     final Long generatedId = dbConnectionManager.executeQuery(dbConnection -> dbConnection.
             .insert(QProject.PROJECT)
             .set(QProject.PROJECT.name, "some name")
             .executeWithId();
     );
 

Returns
  • the id that was populated into the query.

public IdGeneratingSQLInsertClause populate (Object bean)

public IdGeneratingSQLInsertClause populate (T obj, Mapper<T> mapper)

public IdGeneratingSQLInsertClause select (SubQueryExpression<?> sq)

public IdGeneratingSQLInsertClause set (Path<T> path, T value)

public IdGeneratingSQLInsertClause set (Path<T> path, Expression<? extends T> expression)

public IdGeneratingSQLInsertClause setNull (Path<T> path)

public IdGeneratingSQLInsertClause withId ()

Add an automatically generated "ID" column value to the insert statement.

This method uses the Ofbiz sequence generator to generate an Id for the relation being inserted.

Users of this method should not manually add an "ID" using another call such as set(Path, Object) or populate(Object).

Returns
  • clause for building the query.