'use strict'; var Node = require('./index'); module.exports = Node.define({ type: 'COLUMN', constructor: function(config) { Node.call(this); this.name = config.name; this.property = config.property || config.name; this.alias = config.alias; this.star = config.star; this.isConstant = config.isConstant; this.constantValue = config.constantValue; this.asArray = config.asArray; this.aggregator = config.aggregator; this.table = config.table; this.value = config.getValue(); this.dataType = config.dataType; this.distinct = config.distinct; this.primaryKey = config.primaryKey; this.notNull = config.notNull; this.defaultValue = config.defaultValue; this.references = config.references; // If subfieldContainer is present, this is a subfield and subfieldContainer // is the parent Column this.subfieldContainer = config.subfieldContainer; this.subfields = config.subfields; this.autoGenerated = !!config.autoGenerated; this.unique = !!config.unique; }, as: function(alias) { this.alias = alias; return this; } });