Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.3.0)

E17060-01

oracle.odi.generation
Interface IDDLGeneratorService

All Known Implementing Classes:
DDLGeneratorServiceImpl

public interface IDDLGeneratorService

Generate DDL Diffs and DDL Generation User Procedures for a model.

DDL Generator Service that allows manipulating DDL generation options to generate a procedure the can perform the DDL generation.

This service provides a functionality similar to what ODI provides in the UI when using the "Generate DDL" action on an ODI Model.

The following example show how one can choose to generate only new objects in the database: import oracle.odi.generation.support.DDLGeneratorServiceImpl;

 ...
 // Create an instance of the DDL generator using the current ODI Instance
 IDDLGeneratorService ddlgen = new DDLGeneratorServiceImpl(odiInstance);

 // Compute all differences for the ODI model we're working on:
 DDLDifferences diffs = ddlgen.computeDDLDifferences(myOdiModel.getModelId(), myOdiContext.getCode(), false);

 // Get the collection of DDLDiff objects
 Collection<DDLDiff> alldiffs = diffs.getDiffs();

 // Filter out the differences to set only the NEW actions on all differences
 for (DDLDiff diff: alldiffs)
 {
   if (diff.getDiffType() == DDLDiff.DiffType.NEW)
   {
      diff.setToGenerate(true);
   }
 }

 // Finally, generate the ODI procedure
 Number newProcId = ddlgen.generateProcedure(
    "New Procedure000", // Procedure name
    null, // action group we want to use, null -> Generic Action Group
    destinationFolder.getFolderId(), // Odi Folder ID,
    diffs // The list we previously obtained from the DDL Generator service
    );

  // Do something with the procedure...
  ...
 

Users can use any combination of DDLDiff.DiffType and DDLDiff.ObjectType to further refine their DDL code generation options...

Since:
11.1.1.3.0
See Also:
DDLDiff, DDLDifferences

Method Summary
 DDLDifferences computeDDLDifferences(java.lang.Number pOdiModelId, java.lang.String pOdiContextCode, boolean pProcessTablesOutsideOfModel)
           Computes a DDLDifferences object for a given ODI Model ID.
 java.lang.Number generateProcedure(java.lang.String pProcedureName, java.lang.Number pOdiActionGroupId, java.lang.Number pOdiFolderId, DDLDifferences pDDLDifferences)
           Invokes the DDL generator service to create a procedure with all DDL statements that match the list of differences defined in the pDifferences parameter.
 

Method Detail

computeDDLDifferences

DDLDifferences computeDDLDifferences(java.lang.Number pOdiModelId,
                                     java.lang.String pOdiContextCode,
                                     boolean pProcessTablesOutsideOfModel)

Computes a DDLDifferences object for a given ODI Model ID. Note that the differences are calculated between the saved repository model and the database. Changes applied to the model that are not saved will not be used to calculate the differences.

Parameters:
pOdiModelId - Existing ODI Model ID
pOdiContextCode - Context Code for existing OdiContext used to access the tables in a schema.
pProcessTablesOutsideOfModel - Indicator to ask the generator if it needs to compare all tables of the schema with the tables of the ODI Model or limit only to the tables already defined in the ODI model.
Returns:
The DDLDifference object that exposes the list of differences
Throws:
java.lang.IllegalArgumentException - if the pContextCode is not set or pOdiModelId is not set.
DDLGeneratorServiceException - if pOdiContext or pOdiModelId cannot be found, or any other error.

generateProcedure

java.lang.Number generateProcedure(java.lang.String pProcedureName,
                                   java.lang.Number pOdiActionGroupId,
                                   java.lang.Number pOdiFolderId,
                                   DDLDifferences pDDLDifferences)

Invokes the DDL generator service to create a procedure with all DDL statements that match the list of differences defined in the pDifferences parameter.

Parameters:
pProcedureName - Name of the procedure that the generator will create.
pOdiActionGroupId - ID of the ODI Action Group to use. When set to null, it will use the Generic Action Group as defined in ODI Topology.
pOdiFolderId - Destination Folder ID in which the procedure will be created.
pDDLDifferences - the DDLDifferences object as obtained initially from computeDDLDifferences() and eventually modified with setToGenerate(true) on some of the DDLDiff differences.
Returns:
Created ODI Procedure ID.
Throws:
java.lang.IllegalArgumentException - if the pProcedureName is not set, OdiFolderId is null, or DDLDifferences is null.
DDLGeneratorServiceException - if pOdiModelId, pOdiFolderId or pOdiActionGroupId cannot be found, or any oother error.

Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.3.0)

E17060-01

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.