2016-09-26 09:28:47 +00:00
|
|
|
|
|
|
|
var Object = require ('./object');
|
|
|
|
var Expr = require ('./expr');
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
|
|
|
* The equivalent of a SQL statement.
|
2022-05-26 06:08:31 +00:00
|
|
|
*/
|
2016-09-26 09:28:47 +00:00
|
|
|
module.exports = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Object
|
2015-01-23 13:09:30 +00:00
|
|
|
,Properties:
|
|
|
|
{
|
|
|
|
where:
|
|
|
|
{
|
2016-09-26 09:28:47 +00:00
|
|
|
type: Expr
|
2015-01-23 13:09:30 +00:00
|
|
|
,value: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
,target: []
|
|
|
|
|
|
|
|
,addTarget: function (target)
|
|
|
|
{
|
|
|
|
this.target.push (target);
|
|
|
|
}
|
|
|
|
|
|
|
|
,renderTarget: function (batch)
|
|
|
|
{
|
|
|
|
var sql;
|
|
|
|
var len = this.target.length;
|
|
|
|
|
|
|
|
if (len > 0)
|
|
|
|
{
|
|
|
|
sql = ' ';
|
|
|
|
|
|
|
|
for (var n = 0; n < len; n++)
|
|
|
|
{
|
|
|
|
if (n > 0) sql += ', ';
|
|
|
|
sql += this.target[n].render (batch);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
sql += 'DUAL';
|
|
|
|
|
|
|
|
return sql;
|
|
|
|
}
|
|
|
|
});
|