All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.backendless.transaction.UnitOfWorkFindImpl Maven / Gradle / Ivy

The newest version!
package com.backendless.transaction;

import com.backendless.persistence.BackendlessDataQuery;
import com.backendless.persistence.DataQueryBuilder;

import java.util.List;

class UnitOfWorkFindImpl implements UnitOfWorkFind
{
  private final List operations;
  private final OpResultIdGenerator opResultIdGenerator;

  UnitOfWorkFindImpl( List operations, OpResultIdGenerator opResultIdGenerator )
  {
    this.operations = operations;
    this.opResultIdGenerator = opResultIdGenerator;
  }

  @Override
  public OpResult find( String tableName, DataQueryBuilder queryBuilder )
  {
    BackendlessDataQuery query = queryBuilder.build();

    String operationResultId = opResultIdGenerator.generateOpResultId( OperationType.FIND, tableName );

    OperationFind operationFind = new OperationFind<>( OperationType.FIND, tableName, operationResultId, query );

    operations.add( operationFind );

    return TransactionHelper.makeOpResult( tableName, operationResultId, OperationType.FIND );
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy