This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
How would I check if a parent in a one to one relation has a child when the child is nullable Example where Material.Id and Stock.MaterialId have a one to one association I thougth this: var q = Entity.Attribute("Stock") == null; select * from Material where NOT EXISTS (select * from Stock where Stock.MaterialId == Material.Id ) also the opposite would be nice var q = Entity.Attribute("Stock") != null; select * from Material where EXISTS (select * from Stock where Stock.MaterialId == Material.Id ) Is there a different way to get the same result? |
|
|
Did this one get over looked? Or are you guys just real busy about to release a new version? I beieve this would also apply to any EntityHolder association as in a ManyToOne I dont think Enity Holder is Query translateable to SQL
|
|
|
I'll have a look into this for you Tommy. Thanks, John-Daniel Trask |
|
|
Hi Tommy, Try writing your query as: var q = !Entity.Attribute("Stock.MaterialId").Exists() To reverse this, drop the ! operator from the query. I hope this helps, John-Daniel Trask |
|
|
You can even save yourself some keystrokes (and keep the query conceptually closer to your original statement) by dropping the .MaterialId: var q = !Entity.Attribute("Stock").Exists() I knew it was a mistake letting the marketing guy handle a support query... *grin* |
|
|
Hey thanks a million. Dont you hate it when you try something and it doesnt work but later you find out what you tried didnt work because of a different problem you had since fixed but didnt relate to your previous problem.
|
|