We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have one table employee have one foreign key with other table department, and the table column and data below: For empoyee
For department
I have this model define and query below:
... department = persist.define('department', { 'id' : { type : type.INTEGER, dbColumnName : 'department_id', primaryKey : true }, 'department_name' : type.STRING }); employee = persist.define('employee', { 'id' : { type : type.INTEGER, dbColumnName : 'employee_id', primaryKey : true }, 'employee_name' : type.STRING }).hasOne(department); persist.connect({ "driver" : "oracle", "hostname" : "localhost", "user" : "hr", "password" : "welcome1", trace : true }, function(err, connection) { employee.include('department').all(connection, function(err, employees) { if(err) console.log(err); }); }); ...
But the ORM will return this SQL to me:
select t0.employee_id AS c0, t0.employee_name AS c1, t0.department_id AS c2, t1.department_id AS c3, t1.department_name AS c4 FROM employees t0 LEFT JOIN departments t1 ON t1.employee_id=t0.department_id
It is very stange the ORM will use the employee_id as the join key. Anyone also has this issue?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have one table employee have one foreign key with other table department, and the table column and data below:
For empoyee
For department
I have this model define and query below:
But the ORM will return this SQL to me:
It is very stange the ORM will use the employee_id as the join key. Anyone also has this issue?
The text was updated successfully, but these errors were encountered: