不要怂,就是干,撸起袖子干!

Commit bae25d42 by Lemon

Altered join type classification method

1 parent 54e16687
...@@ -187,7 +187,7 @@ module.exports = (function() { ...@@ -187,7 +187,7 @@ module.exports = (function() {
optAttributes = optAttributes.concat(attributes) optAttributes = optAttributes.concat(attributes)
if (include.association.associationType !== 'HasMany') { if (!include.association.connectorDAO) {
var table = include.daoFactory.tableName var table = include.daoFactory.tableName
var as = include.as var as = include.as
var tableLeft = ((include.association.associationType === 'BelongsTo') ? include.as : tableName) var tableLeft = ((include.association.associationType === 'BelongsTo') ? include.as : tableName)
......
...@@ -258,7 +258,7 @@ module.exports = (function() { ...@@ -258,7 +258,7 @@ module.exports = (function() {
optAttributes = optAttributes.concat(attributes) optAttributes = optAttributes.concat(attributes)
if (include.association.associationType !== 'HasMany') { if (!include.association.connectorDAO) {
var joinQuery = ' LEFT OUTER JOIN <%= table %> AS <%= as %> ON <%= tableLeft %>.<%= attrLeft %> = <%= tableRight %>.<%= attrRight %>' var joinQuery = ' LEFT OUTER JOIN <%= table %> AS <%= as %> ON <%= tableLeft %>.<%= attrLeft %> = <%= tableRight %>.<%= attrRight %>'
query += Utils._.template(joinQuery)({ query += Utils._.template(joinQuery)({
......
...@@ -169,7 +169,7 @@ module.exports = (function() { ...@@ -169,7 +169,7 @@ module.exports = (function() {
optAttributes = optAttributes.concat(attributes) optAttributes = optAttributes.concat(attributes)
if (include.association.associationType !== 'HasMany') { if (!include.association.connectorDAO) {
var table = include.daoFactory.tableName var table = include.daoFactory.tableName
var as = include.as var as = include.as
var tableLeft = ((include.association.associationType === 'BelongsTo') ? include.as : tableName) var tableLeft = ((include.association.associationType === 'BelongsTo') ? include.as : tableName)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!