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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -