java - ForeignCollection auto load with queryRaw() -


i have card class, has eager foreigncollection in it. have query instances of class dao.queryraw(), because select complicated built simple querybuilder (see other question). how query , build objects rawrowmapper:

genericrawresults<string[]> rawresults = getcarddao().queryraw(statement); list<card> results = new arraylist<card>();  (string[] row : rawresults) {     results.add(getcarddao().getrawrowmapper().maprow(rawresults.getcolumnnames(), row)); }  rawresults.close(); 

unfortunately when try foreigncollection on objects, returns null. if query objects simple dao.queryforfirst, foreigncollection ok.

i have had same problem today. solution has been call

dao.refresh(<card object>) 

for every object returned queryraw function (and accumulated "results" list). trick me, reloading objects db filled foreign collection.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -