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
|
I have an entity that maps to a database table that I do usual CRUD operations on using lightspeed. But in one part of my app - I also need some additional calculated fields to be included with the entity. These are not persisted in the table, but are calculated in a special stored proc that does some heavy DB lifting to populate them - and returns them along with all the other standard fields that are part of the entity. How do I setup the aggregate/special fields in the entity so they are ignored for all normal CRUD operations - and yet will still be loaded when I load the entity from my stored proc? Marking them Transient means they are always ignored - even when the returned results contain values for those fields. But marking them LoadOnly means they are also attempted to be loaded with normal CRUD loads. |
|
|
You will need to create a separate entity for this which has the additional fields, or use transient fields on the existing entity and load the data independantly and populate those fields. Ordinarily you might handle this via named aggregates where you could just conditionally load those fields when the aggregate is specified however named aggregate support does not extend to stored procs. Marking a field as transient means that LightSpeed ignores it, transient fields are there to allow you to have fields which are used within your entity but should not be considered for materialization/persistence.
|
|