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
|
Now I want to try it again, because you seem to be open to improvments/suggestions and you still have the best sqlite designer etc. support. One question I still have before I start with the massive bug testing ;-) Can I load related entities like Customer has many Documents where I want to avoid loading the DocumentData/byte[] just a string property like DocumentName is what I want?! I just want to lazy load the DocumentData when the user clicks on an item. Is that possible with SQLite and how?
|
|
|
Yes, you can lazy load fields by using a named aggregate. A field which is declared as part of an aggregate (or, equivalently, has the [EagerLoad("SomeAggregate")] attribute) will not be loaded until it is accessed, *unless* you specify the matching aggregate name in the query. So for the Document class, suppose you mark the DocumentData property with the aggregate name "Details". Then if you write: * uow.Documents - it will not load the DocumentData blob (but will load the other columns) * someDocument.DocumentData - it will load the DocumentData blob if not already loaded (resulting in an additional query to the database, of course) * uow.Documents.WithAggregate("Details") - it will load the DocumentData blob alongside the other columns (so you will not incur the additional query when you access the DocumentData property) If Customer.Documents is marked as eager-load, then the DocumentData blob will still be excluded from the initial load unless you ask for it: * uow.Customers - will load customers and their associated documents in one SQL query, but will not load the DocumentData blob. (DocumentData will still be loaded on demand if required.) * uow.Customers.WithAggregate("Details") - will load customers and their associated documents including the DocumentData blob, all in one SQL query. This works with all SQL-based providers (currently everything except Amazon SimpleDB), including SQLite. For more info see Named Aggregates on this page of the help file: http://www.mindscape.co.nz/Help/LightSpeed/Help%20Topics/LightSpeed/AdvancedQuerying.html |
|
|
nice nice... prepare youself for a massive bug reporting festival around midst-end December ;-) 8 tables for free is a gift thank you. I need exactly that quantity to start my app in commercial mode...
cheers, bastien |
|