2016-09-26 09:28:47 +00:00
|
|
|
|
|
|
|
var Expr = require ('./expr');
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
|
|
|
* The equivalent of a SQL field.
|
|
|
|
*
|
|
|
|
* @param {string} taget The name of the owner table
|
2016-12-20 09:32:17 +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: Expr
|
2015-01-23 13:09:30 +00:00
|
|
|
,Tag: 'sql-field'
|
|
|
|
,Properties:
|
|
|
|
{
|
2017-04-19 06:16:37 +00:00
|
|
|
/**
|
|
|
|
* The column name.
|
|
|
|
*/
|
2015-01-23 13:09:30 +00:00
|
|
|
name:
|
|
|
|
{
|
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
},
|
2017-04-19 06:16:37 +00:00
|
|
|
/**
|
|
|
|
* The source table name or its alias if it has been specified.
|
|
|
|
*/
|
2015-01-23 13:09:30 +00:00
|
|
|
target:
|
|
|
|
{
|
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-19 06:16:37 +00:00
|
|
|
,render: function ()
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
2017-11-16 14:53:20 +00:00
|
|
|
return this.renderPreIdent (this.target)
|
|
|
|
+ this.renderIdent (this.name);
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
});
|