I've tried some things, and I'm a bit further...
I know have this query:
Code:
select ol from OrderLine ol, Order o, Customer c
where ol.Owner = o, o.Owner = c
This works. This gives me all the orderlines.
However, when I want to filter here, on customer Id, it doesn't work anymore:
Code:
select ol from OrderLine ol, Order o, Customer c
where ol.Owner = o, o.Owner = c
and c.Id = :custId
I set the named parameter, and when I execute the List() method of the IQuery, I receive an exception that says:
Quote:
Could not ressolve property:Id of of :ShopDomain.Customer
However, my Customer class does have a property that is named Id.
:?
Also, when I try to write the query like ths
Code:
select ol from ShopDomain.OrderLine ol
inner join ShopDomain.Order o
inner join ShopDomain.Customer c
I'm given an exception that says:
Quote:
outer or full join must be followed by path expression
I haven't found any HQL resources on the net that tell me what 's wrong with it...
update:
Ok, I've found out that the Id property was not mentioned in my mapping file; the id element in my mapping file is referencing to the field _id and not to the property Id.
So, I've added a property 'Id' in my mapping file now, with update='false' and insert='false' attributes.
However, this property is read-only (getter only), so I have now a problem while retrieving a Customer. I get an exception that says 'ArgumentException while setting the property value by reflection...'
This is offcourse, because I do not have a setter. However, there must be some way to set this property to read-only in the mapping file, so i'm going to search a bit for it.