The lazyLoading attribute is one of the table (TableConfiguration object) attributes. The object tableConfiguration can be retrieved from <table_name>DO.java class by calling method:
getConfigurationAdministration().getTableConfiguration()
This methods returns org.enhydra.dods.cache.TableConfiguration object. The lazyLoading attribute can be handled with the following methods of TableConfiguration object:
isLazyLoading() - Returns current value of lazyLoading attribute.
Lazy loading is a mechanism that postpones the loading of DO's data (DataStruct objects) until they are needed. This mechanism is used in the protected method:
createExisting(ObjectId id)
or the same method with the combinations of parameters:
createExisting( String dbName, ObjectId id, [HashMap refs])
or
createExisting( ObjectId id, [HashMap refs], [DBTransaction dbTrans])
This method creates a DO with specified Oid (DO without data), and than, if it is not lazy loading, calls method
loadData()
to load the fields for the DO from the database.
For, example, DODS uses this method in select clauses (runQuery() method) when are created referenced objects - when is used method
createExisting( [String dbName], BigDecimal bd )
which calls mentioned method createExisting with the ObjectId parameter and combination of dbName,refs and dbTrans parameters. So, if lazy loading is used, we always select T.oid and create DO without data. Later if this referenced object is needed data is loaded using method:
checkLoad()
(using select T.* queries) of <table_name>DO.java class. This method checks whether the DO's original data is loaded, and if it isn't, this method loads colums data and version by calling:
loadData()
method.