Details
Description
Suppose class A and B, and B extends A, and an object with key 1 is an instance of Class B.
Now we load (A, 1), the SQLStatementLoad.executeStatement method will be executed twice, and the select statement will be executed twice, too. Because A is the superclass, then in the first execution, the concrete class is determined, and in the second execution, the entity are loaded and molded.
If we load (B, 1), the SQLStatementLoad.executeStatement will execute once.
I think the second execution will not be so necessary, it may be a performance problem. We should eliminate the second execution.
In this patch, I'll cache the first result in the SQLStatementLoading.executeStatement, then I'll use the cached results in the second loading.
If I'll just cache the results, the test96 will fail, because in test96, the first loading will not load the whole object, so I make changes with "addCols(tbl, joinTableInfos, mainTbl, true);". Then the first loading will get all the columns about the ExtendedObject.