@sap/xsodata
Version:
Expose data from a HANA database as OData V2 service with help of .xsodata files.
50 lines (42 loc) • 1.58 kB
JavaScript
;
const async = require('async');
const utils = require('./../utils/utils');
const dataCollectorGet = require('./../sql/dataCollectorGet');
const serializer = require('./../serializer/serializer');
const sqlGet = require('./../sql/createGetStatements');
exports.process = function (context, asyncDone) {
context.logger.silly('resourceprocessor', 'process_GET');
async.waterfall(
[
utils.injectContext(context),
utils.tryAndMeasure(
sqlGet.createGetSqlStatements,
'sqlGet.createGetSqlStatements'
),
utils.tryAndMeasure(
dataCollectorGet.createTmpTables,
'dataCollectorGet.createTmpTables'
), //create //NEW ORL
utils.tryAndMeasure(
dataCollectorGet.insertFillTmpTables,
'dataCollectorGet.insertFillTmpTables'
),
utils.tryAndMeasure(
dataCollectorGet.select,
'dataCollectorGet.select'
),
// truncate temporary tables to clean the session
utils.try(dataCollectorGet.truncateTempTables),
// drop temporary tables to clean the session
utils.try(dataCollectorGet.dropTempTables),
utils.try(dataCollectorGet.commit),
utils.tryAndMeasure(
serializer.serializeData,
'serializer.serializeData'
),
],
function (err, context) {
return asyncDone(err, context);
}
);
};