Ah,

well, I got myself around that problem by a simple groovy script. I wanted
to share the result in case that anybody else got the problem. 



Note that the following approach is a fall-back to the classical SQL -
commands and may therefore NOT be recommended!



---
String sqlCommand = "SELECT * FROM Products";
records = [];

String helperName = delegator.getGroupHelperName("org.ofbiz");    // gets
the helper (localderby, localmysql, localpostgres, etc.) for your entity
group org.ofbiz
SQLProcessor sqlproc = new SQLProcessor(helperName);
rs = sqlproc.executeQuery(sqlCommand);
                                        
records = [];
numberOfColumns = rs.getMetaData().getColumnCount();

                while (rs.next()) {
                    record = [:];
                    rs.getMetaData()
                    for (i = 1; i <= numberOfColumns; i++) {
                   
record.put(rs.getMetaData().getColumnName(i),rs.getObject(i));
                    }
                    records.add(record);
                }

context.put("sqlresult",records);
----


The above script should call any of your sql-statements in sqlCommand and
return the results in a matter that can be easily processed by the
freemarker templates (ftl files). The result is similar to any result given
by a regular delegator call, so you can access the data in your ftl file via
${sqlresult.columnname}


Cheers,
Paul
-- 
View this message in context: 
http://www.nabble.com/View-Entities-Group-by-month-tp22327481p22348087.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply via email to