You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
driver.js: Oracle does not permit quoted columns in ORDER BY
getSqlFromSqlTree: function(sqlTree) {
...
//var orderByClause = this.escapeColumnName(orderBy.column.alias) + ' ';
var orderByClause = orderBy.column.alias + ' ';
model.js: to accept one-to-many relationship in both directions:
Model.hasMany = function (associatedModel, opts) {
...
if (opts.through) {
...
} else if (opts.createHasOne) {
var associatedOpts = {};
associatedOpts.name = opts.hasOneName;
associatedOpts.foreignKey = opts.foreignKey;
associatedOpts = this.normalizeHasOneOptions(this, associatedOpts);
associatedModel.hasOne(this, associatedOpts);
}
...
Model.hasOne = function (associatedModel, opts) {
...
var foreignKeyPropertyName = inflection.camelize(opts.foreignKey, true);
if (!this.columns[foreignKeyPropertyName] || !this.columns[foreignKeyPropertyName].foreignKey) {
this.addColumn(foreignKeyPropertyName, { type: "int", foreignKey: true });
}
if (opts.createHasMany) {
var associatedOpts = {};
associatedOpts.name = opts.hasManyName;
associatedOpts.foreignKey = opts.foreignKey;
associatedOpts = this.normalizeHasManyOptions(this, associatedOpts);
associatedModel.hasMany(this, associatedOpts);
}
Good luck!
The text was updated successfully, but these errors were encountered:
and I also had to modify executeBaton.cpp in order to accept bool values back to DB:
void ExecuteBaton::CopyValuesToBaton(ExecuteBaton* baton, v8::Localv8::Array* values) {
...
// boolean
else if(val->IsBoolean()) {
bool b = val->IsTrue();
value->type = VALUE_TYPE_STRING;
value->value = new std::string(b ? "T" : "F");
baton->values.push_back(value);
}
It may be another way to specify trueValue and falseValue just in the model, but for me it's enough
toObject: function (row, result) {
...
if (column.modelColumn.type === type.BOOLEAN && (val !== null)) {
//val = !!val;
val = [true, 1].indexOf(val) != -1 || (val.length > 0 && ['T', 't', 'Y', 'y', '1'].indexOf(val[0]) != -1);
(probably, setter requires changes too, Delphi uses 'F' / 'T' in SetAsBoolean()
getSqlFromSqlTree: function(sqlTree) {
...
//var orderByClause = this.escapeColumnName(orderBy.column.alias) + ' ';
var orderByClause = orderBy.column.alias + ' ';
Model.hasMany = function (associatedModel, opts) {
...
if (opts.through) {
...
} else if (opts.createHasOne) {
var associatedOpts = {};
associatedOpts.name = opts.hasOneName;
associatedOpts.foreignKey = opts.foreignKey;
associatedOpts = this.normalizeHasOneOptions(this, associatedOpts);
associatedModel.hasOne(this, associatedOpts);
}
...
Model.hasOne = function (associatedModel, opts) {
...
var foreignKeyPropertyName = inflection.camelize(opts.foreignKey, true);
if (!this.columns[foreignKeyPropertyName] || !this.columns[foreignKeyPropertyName].foreignKey) {
this.addColumn(foreignKeyPropertyName, { type: "int", foreignKey: true });
}
Good luck!
The text was updated successfully, but these errors were encountered: