Using XData/Modeller Joins in TMS Web App

Hi,

I have searched the forums but am unable to find a solution to this. The following an abbreviated version of the nxDatabase query I would normally use:

select H."GUID",H.HouseRef,H.AskPrice,H.Advertisement,I0.SmallImage MainImage,I1.SmallImage Image1,I2.SmallImage Image2
from Houses H
left join Images I0 on I0.HouseGUID=H."GUID" and I0.ImageType=0
left join Images I1 on I1.HouseGUID=H."GUID" and I1.ImageType=1 and I1."Order"=1
left join Images I2 on I2.HouseGUID=H."GUID" and I2.ImageType=1 and I2."Order"=2
where (not H.Archived) and H.UploadToWeb

Column SmallImage is a jpg image.

I've looked at associations but cannot see how I can get this to work.

Any help greatly appreciated.

Thanks,

Ken

Are you referring to using XData with Aurelius? Because you can simply execute such SQL statement directly in NexusDB with XData and return the values using JSON.
If you mean using Aurelius, then you will have to change your paradigm of SQL and think about modeled classes. How are your classes mapped?

Because you can simply execute such SQL statement directly in NexusDB with XData and return the values using JSON.

I have seen this alluded to in the documentation but could not find any details or sample code on how to do this. Could you please point me in the right direction?

There is a XData demo in folder firedac-sql that shows how to use XData that way, it's very detailed. Of course it uses FireDAC but the idea is exactly the same, you just use the database-access component of your choice.

Thanks Wagner. Just what I needed.

1 Like

Not there yet unfortunately. I have my server running ok I believe but, as stated, I need the client side to be a TMS Web App. Adding the equivalent of the CustomerService unit to my project won't compile ( XData.Service.Common not found) so how do I do this in TMS Web? An example would be greatly appreciated.

Wagner. I humbly apologise. Please ignore this as I didn't notice that there was a web client folder for this sample.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.