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
|
Lightspeed generates the relationships to entities linked by foreign keys. When I do a join and read a Tupel I can access a linked object via property name of the foreign key field but this only works with an active uow .. once it is disposed this does not work anymore. Why ? I would like to avoid to map fields to a primary entity via partial class and rather access properties of a linked entity via the "EntityHolder" How can I do that ? regards gmd |
|
|
Just to clarify my understanding of what you are asking, you are referring to wanting to access properties of an association object - e.g. if you have a Cart entity with a collection of CartItem children you would like to be able to call something like item.Cart.SomeProperty from a CartItem instance, but this generates an exception if you dont have a UnitOfWork. If thats correct what is occuring is that we lazily load the Cart instance in the above example at the moment you first want to read it (this avoids us having to load the data initially and avoiding generating an unnecessary query). If you dont have an active UnitOfWork then there is no database connection so we cannot load it. To get around this you can set the association to be eagerly loaded which will load the Cart instance along with the CartItem and it will be available even when detached. You can also conditionally have this occur through the use of Named Aggregates. This is explained in a bit more detail in the documentation if you want to have a read through that here: http://www.mindscapehq.com/documentation/lightspeed/Performance-and-Tuning/Controlling-How-Entities-Load
|
|
|
Thanks Jeremy, I think this is what I need .. I have read the docs but obviously have not absorbed and understood everything properly .. I will give it a try thanks again gmd |
|