Hello,
To be honest I don't know if it is an issue or I am doing something wrong.
This is my query:
var q = new joli.query()
.select('item.*')
.from('orderitem')
.order(['orderitem_id desc'])
.join('orders','orders.order_id','orderitem.order_id')
.join('item','item.item_id','orderitem.item_id');
var items = q.execute();
So far I can see Joli is properly constructing the query :
select item.*
from orderitem left outer join orders on orders.order_id = orderitem.order_id
left outer join item on item.item_id = orderitem.item_id
order by orderitem_id desc
The problem is that items collection only return orderitem's fields rather than the item's fields.
This is what each returning record has:
I/TiAPI ( 1598): key in _options
I/TiAPI ( 1598): key in _data
I/TiAPI ( 1598): key in _originalData
I/TiAPI ( 1598): key in isNew
I/TiAPI ( 1598): key in orderitem_id
I/TiAPI ( 1598): key in order_id
I/TiAPI ( 1598): key in item_id
I/TiAPI ( 1598): key in item_quantity
I/TiAPI ( 1598): key in beer_quantity
I/TiAPI ( 1598): key in orderitem_type
I/TiAPI ( 1598): key in beer_id
Those are all fields belonging to orderitem instead of item table as I expected.
Hello, To be honest I don't know if it is an issue or I am doing something wrong. This is my query:
So far I can see Joli is properly constructing the query :
The problem is that items collection only return orderitem's fields rather than the item's fields.
This is what each returning record has:
Those are all fields belonging to orderitem instead of item table as I expected.
Thanks! nico.