After a bit of effort I've nearly got iReport's (GUI for Jasper Reports)
JavaBean DataSource connection working to a Cayenne (M9) object. Sadly
now I get this:
java.lang.NullPointerException
at
org.objectstyle.cayenne.access.ObjectResolver.<init>(ObjectResolver.java:98)
at
org.objectstyle.cayenne.access.DataContext.objectsFromDataRows(DataContext.java:682)
at
org.objectstyle.cayenne.access.DataContext.objectsFromDataRows(DataContext.java:701)
at
RptInvoicesErroredToDate.getReportData(RptInvoicesErroredToDate.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
it.businesslogic.ireport.gui.ConnectionDialog.jButtonOK1ActionPerformed(ConnectionDialog.java:834)
The calling code (RptInvoicesErroredToDate):
public static List getReportData() throws DBException {
DataContext dataContext = DataContext.createDataContext();
// Get a handle to the stored proc
final ProcedureQuery query = new
ProcedureQuery("rpt_invoices_errored_to_date");
List list = new ArrayList<RptInvoicesErroredToDate>();
try {
// Run the report and get the results
final List rows = dataContext.performQuery(query);
// Because we get raw rows from the stored proc transform
them into the correct object types (in the list)
list =
dataContext.objectsFromDataRows(RptInvoicesErroredToDate.class,
rows, false, false);
} catch (Exception e) {
throw new DBException("Could not get report data", e);
}
return list;
}
With the JavaBean connection you supply a Factory and static method to
call. I'd like to use this method over Jasper/JDBC or XML datasources.
All this works properly though from my test harness.
It appears to me that there is a problem with the DataMaps hence the
entity's can't be resolved?
If anyone has any pointers to the problem, I'd be grateful.
Thanks.
-- http://www.fastmail.fm - Access your email from home and the web
This archive was generated by hypermail 2.0.0 : Mon Jan 16 2006 - 00:59:22 EST