Search code examples
javadata-access-layeropenbravo

using action handler to Fetch Record from OBProvider.getInstance().get(class)


Want u fetch all record from a table which name is shipment type

ShipmentType st = OBProvider.getInstance().get(ShipmentType.class);

what should i use to know the lenght of it to run a for loop

Example:

for(i=0;i<=st.getID.length();i++;) {
 ToDo my action 
}

PS:Using Openbravo


Solution

  • There are multiple ways to fetch records from Openbravo's DAL.

    • OBCriteria
    • OBQuery
    • Using SQL/HQL Query Interface.

    check the documentation of OBQuery here.

    Check the implementation of OBCriteria in Openbravo's wiki page.