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
|
Hi Im using FindBySql to do a complex query that involves a left outer join between two tables, were the schema's belong to different users. My primary object has its properties loaded, however the secondary object (which could be null) is never loaded, even when they query contains information for it. cmd = "select a.*, b.* from a left outer join a.key = b.key where blah;" var list = uow.FindBySql<AObject>(cmd)
If I have another object "BObject", how can I load both when the information exists, without doing multiple queries on the db. I want to take advantage of the fact that my join will bring back the data, whens its available.
|
|
|
Furthermore , can Lightspeed would allow 2 tables from different schema's (same DB) to be in the same model? At the moment the designed is giving me "All tables selected must have the same owner" error. That way one object should instanciate the other. Thanks for your quick reply, Josh |
|
|
So no thought on either issue: 1) returning multiple objects with FindBySQl Command or 2) multiple Schema's in the same model
Thanks, Josh |
|
|
Hi Josh, Sorry for the delay - we are all currently out of office at TechEd currently. Re: #1 - FindBySql only supports returning a single entity type, there isnt currently any support for multiple entities out of a single result set - this is consistent with what we do with stored procedures. Are you not able to express your query using LINQ or by using the Project method? Re: #2 - There is a Schema property per entity in the model designer and you can certainly have multiple schemas per model so I am not too sure if this is just an issue relating to dragging multiple entities with multiple schemas on at the same time or something else perhaps? Do you still get the problem if you drag the entities on one at a time?
Jeremy |
|
|
Hi Jeremy,
I'm still having this error. I am using 2 tables in from an oracle database. one table from Schema A and the other from Schema B. There is a relationship between these tabels. When I drag and drop them one at a time they both appear on the model but when i update the model from source it will throw and error. When I drag the tables on together it throws the following error.
All tables selected must have the same owner: Exception while processing Server Explorer drag: Mindscape.LightSpeed.Generator.Model.GenerationException: All tables selected must have the same owner
|
|
|
It's a limitation of LightSpeed. As the error message says: "All tables selected must have the same owner." (i.e. must come from the same schema) Drag on the table from Schema A and the table from Schema B separately. When updating, you will need to update the tables independently (select table A and do an Update From Source, then select table B and do an Update From Source) -- however it is possible that the presence of the association will still cause issues. I will look at whether we can relax this limitation but I can't make any promises! |
|
|
That's quite unfortunate, I quess i will have to code this up myself in the partial classes :-( |
|