1

Has anyone figured out how to return the SQL for an object that is in Webi using the Rebean API? I have got the ReportExpression of the column but, from there I am having a difficult time retrieving the SQL of the object.

Thanks

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
XanderLynn
  • 883
  • 3
  • 16
  • 29

1 Answers1

2

I believe you have gone to far into the structure. To get the SQL that is generated you should go through the DataProvider of the rebean. I have not attempted this to see what values I got, but looking at the API methods the getQuery().getSQL() methods of the DataProvider appear to be what you are looking for.

For better clarity:

DocumentInstance docInst; // get your DocumentInstance object via preferred route
DataProvider dp = docInst.getDataProviders().getItem(0); // retrieve the DataProvider that youw ould like the SQL for
String sql = dp.getQuery().getSQL(); // the SQL out of the DataProvider

getSQL() is deprecated so it may disappear in the next version

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
shrub34
  • 796
  • 6
  • 17