sdepold/sequelize — Issue #115: How to define bridge class as e.g.PurchaseOrder 
Author: conanchen
Created: 2011-12-11 17:06:42+00:00
State: open

i have classes: User, Product. I want to define a PurchaseOrder class, I tried the following code but failed:-

sequelize.define('User'
sequelize.define('Product'
sequelize.define('PurchaseOrder'

PurchaseOrder.hasOne(User) //--> this will create a PurchaseOrderId in User table, that is not what I want.
PurchaseOrder.hasOne(Product)

I hope I can access PurchaseOrder's User or Product by :-

PurchaseOrder.setUser()
PurchaseOrder.setProduct()

but sequelize complains there is no setUser() method,