Aleksandar Vidakovic created FINERACT-3075:
----------------------------------------------

             Summary: Type safe query: [SQL 034] Save 
(CustomJobParameterRepositoryImpl:50)
                 Key: FINERACT-3075
                 URL: https://issues.apache.org/jira/browse/FINERACT-3075
             Project: Apache Fineract
          Issue Type: Sub-task
            Reporter: Aleksandar Vidakovic


*Entry 34* of the native SQL inventory \(INSERT, module fineract\-core\).

Source: 
[CustomJobParameterRepositoryImpl.java#L50|https://github.com/apache/fineract/blob/0f677b99aa453ea5be4f2e0115562e85ad1db012/fineract-core/src/main/java/org/apache/fineract/infrastructure/jobs/domain/CustomJobParameterRepositoryImpl.java#L50]

Status: Translation generated automatically; needs review and compilation.

h3. Native SQL \(as built by the Java code\)
{code:language=sql}
INSERT INTO batch_custom_job_parameters (parameter_json)
VALUES (:jsonString)
{code}

h3. Proposed QueryDSL translation
{code:language=java}
// imports
import com.querydsl.sql.SQLQueryFactory;
import org.apache.fineract.querydsl.QBatchCustomJobParameters; // generated 
Q-type, see README.txt

// method parameters used below
//   String jsonstring

QBatchCustomJobParameters batchCustomJobParameters = new 
QBatchCustomJobParameters("batchCustomJobParameters");

long inserted = queryFactory.insert(batchCustomJobParameters)
    .set(batchCustomJobParameters.parameterJson, jsonstring)
    .execute();
{code}

h3. Done when
* QueryDSL version compiles against the generated Q\-types
* Behaviour matches the native query \(same rows, same parameters\) on 
MySQL/MariaDB and PostgreSQL
* Existing tests pass, or a test covering the query was added
* The native SQL string is removed





--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to