My business object has some collections. I want to use retrieveAutomatic=false for collections. how should I retrieve a collection when the user accesses them?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1. Don't instantiate the collection when the object is created.
2. When someone accesses the collection (via the property-get) you should set up a retrieve criteria to load the relevant objects from the database and add them to the collection. (or you can use one of the getAll methods if appropriate)
3. Return the collection out of the property-get
There are other ways to do this, such as instantiating the collection and tracking the lazy load via a flag, etc.
Hope that helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My business object has some collections. I want to use retrieveAutomatic=false for collections. how should I retrieve a collection when the user accesses them?
1. Don't instantiate the collection when the object is created.
2. When someone accesses the collection (via the property-get) you should set up a retrieve criteria to load the relevant objects from the database and add them to the collection. (or you can use one of the getAll methods if appropriate)
3. Return the collection out of the property-get
There are other ways to do this, such as instantiating the collection and tracking the lazy load via a flag, etc.
Hope that helps.