// Create the ParamArray
ParamArray parms = new ParamArray(1); // Create the ProDataGraphMetaData ProDataGraphMetaData dgMetaData = new ProDataGraphMetaData("dsCustOrd"); // Create the ProDataObjectMetaData for the Customer table ProDataObjectMetaData doCustMD = new ProDataObjectMetaData ("ttCust", 3, false, 0, null, null, null); doCustMD.setFieldMetaData (1, "CustNum", 0, Parameter.PRO_INTEGER, 0, 0); doCustMD.setFieldMetaData (2, "Name", 0, Parameter.PRO_CHARACTER, 1, 0); doCustMD.setFieldMetaData (3, "SalesRep", 0, Parameter.PRO_CHARACTER, 2, 0); // Create the ProDataObjectMetaData for the Order table ProDataObjectMetaData doOrderMD = new ProDataObjectMetaData("OrderDetails", 6, false, 0, null, null, null); doOrderMD.setFieldMetaData (1, "OrderNum", 0, Parameter.PRO_INTEGER, 0, 0); doOrderMD.setFieldMetaData (2, "SalesRep", 0, Parameter.PRO_CHARACTER, 1, 0); doOrderMD.setFieldMetaData (3, "OrderDate", 0, Parameter.PRO_DATE, 2, 0); doOrderMD.setFieldMetaData (4, "ShipDate", 0, Parameter.PRO_DATE, 3, 0); doOrderMD.setFieldMetaData (5, "TotalDollars", 0, Parameter.PRO_DECIMAL, 4, 0); doOrderMD.setFieldMetaData (6, "OrderStatus", 0, Parameter.PRO_CHARACTER, 5, 0); // Add the tables to the ProDataGraph meta data dgMetaData.addTable(doCustMD); dgMetaData.addTable(doOrderMD); // Create and add the relations to the DataSet meta data ProDataRelationMetaData relation = new ProDataRelationMetaData ("custNum", 0, 1, 1, "CustNum,CustNum"); dgMetaData.addDataRelation(relation); parms.addDataset(0, null, ParamArrayMode.OUTPUT, dgMetaData); |