This XML document is sample input to
JET transformations
with the GenProcedureInlineSample.jet, GenProcedureInlineJunit.jet, GenProcedureInterface.jet, GenProcedureInterfaceJunit.jet, GenProcedureInterfaceTest.jet,
or GenProcedureParmBean.jet templates.
The XML describes
the stored procedure salaryGreater,
which takes the IN parameter salvalue. The stored procedure returns
a result set that contains all rows from the STAFF table where SALARY
is greater than the value of the IN parameter.
<?xml version="1.0" encoding="UTF-8"?>
<genCodeData>
<selection genAlwaysJUnit="false" genIncludeConn="false"
genInlineSample="true" genInterface="true" genInterfaceTest="true"
genSampleUtil="false" genType="genFromProcedure" />
<connection name="SAMPLE1" />
<procedure handlerClass="" includeSchemaInSQL="false"
name="SALARY_GREATER" schema="MYSCHEMA">
<procParameters genBean="true" genPublicFields="false"
importTypes="import java.math.BigDecimal;" name="Salary_greaterParam"
package="myPackage" srcContainer="MyProject/src"
superClass="java.lang.Object">
<parameter javaType="BigDecimal" name="salvalue" parameterMode="1" parameterType="DECIMAL"/>
</procParameters>
<interface importAnnotations=""
importTypes="import java.math.BigDecimal;" interfaceMerge="false"
interfaceName="Salary_greaterData" package="myPackage"
srcContainer="MyProject/src" />
<testCode
importTypes="import java.math.BigDecimal;import java.util.Iterator;"
inlineSampleName="Salary_greaterInlineSample"
interfaceTestName="Salary_greaterDataTest" package="myPackage"
srcContainer="MyProject/src" />
<results>
<resultSet>
<bean genBean="true" genPublicFields="false"
importAnnotations="" importTypes="import java.math.BigDecimal;"
name="Salary_greater" package="myPackage"
srcContainer="MyProject/src" superClass="" />
<fieldInfos>
<field>
<column colLength="" colType="SMALLINT"
isAlwaysGenCol="false" isIdentityCol="false" isKey="false"
isUniqueColName="true" isUserDefinedType="false" name="ID"
tableName="SALARY_GREATER" />
<parameter accessor="getId()" javaType="short"
name="id" propertyName="id" />
</field>
<field>
<column colLength="" colType="VARCHAR"
isAlwaysGenCol="false" isIdentityCol="false" isKey="false"
isUniqueColName="true" isUserDefinedType="false" name="NAME"
tableName="SALARY_GREATER" />
<parameter accessor="getName()"
javaType="String" name="name" propertyName="name" />
</field>
<field>
<column colLength="" colType="SMALLINT"
isAlwaysGenCol="false" isIdentityCol="false" isKey="false"
isUniqueColName="true" isUserDefinedType="false" name="DEPT"
tableName="SALARY_GREATER" />
<parameter accessor="getDept()" javaType="short"
name="dept" propertyName="dept" />
</field>
<field>
<column colLength="" colType="CHAR"
isAlwaysGenCol="false" isIdentityCol="false" isKey="false"
isUniqueColName="true" isUserDefinedType="false" name="JOB"
tableName="SALARY_GREATER" />
<parameter accessor="getJob()" javaType="String"
name="job" propertyName="job" />
</field>
<field>
<column colLength="" colType="SMALLINT"
isAlwaysGenCol="false" isIdentityCol="false" isKey="false"
isUniqueColName="true" isUserDefinedType="false" name="YEARS"
tableName="SALARY_GREATER" />
<parameter accessor="getYears()"
javaType="short" name="years" propertyName="years" />
</field>
<field>
<column colLength="" colType="DECIMAL"
isAlwaysGenCol="false" isIdentityCol="false" isKey="false"
isUniqueColName="true" isUserDefinedType="false" name="SALARY"
tableName="SALARY_GREATER" />
<parameter accessor="getSalary()"
javaType="BigDecimal" name="salary" propertyName="salary" />
</field>
<field>
<column colLength="" colType="DECIMAL"
isAlwaysGenCol="false" isIdentityCol="false" isKey="false"
isUniqueColName="true" isUserDefinedType="false" name="COMM"
tableName="SALARY_GREATER" />
<parameter accessor="getComm()"
javaType="BigDecimal" name="comm" propertyName="comm" />
</field>
</fieldInfos>
</resultSet>
</results>
</procedure>
</genCodeData>
- bean
- The attributes of this tag describe the generated bean for a single
result set.
- genBean
- Specifies
whether to create a new bean or whether the bean tag
describes an existing bean.
- true
- Create a new bean.
- false
- The bean tag describes an existing bean.
- genPublicFields
- Specifies the access level of the properties of the bean.
- A
value of true generates the properties of the bean as public.
- A
value of false generates the properties of the bean as protected
and allows access to them through get and set methods.
- importAnnotations
- Specifies
whether to import the pureQuery annotations. Acceptable
values are as follow:
- mport com.ibm.pdq.annotation.Column;
- import com.ibm.pdq.annotation.Table;
- The bean must import the Table annotation if the name
of the bean
does not match the name of the corresponding database object.
- The
bean must also import the Column annotation if one or more
names of the properties in the beans do not match their corresponding
columns or parameters in the database object.
- The bean can
import the Id annotation if you want to use that
annotation to show which columns are part of a primary key.
- importTypes
- Specifies
which Java types
to import. You must import all types that are not part of the java.lang.*
package.
- name
- Specifies
the name of the bean.
- package
- Specifies the name of the Java package
in which to place the generated code.
- srcContainer
- Specifies the folder within the project in which to place the
generated code.
- superClass
- Specifies the superclass of the bean.
- column
- The attributes
of this tag describe a column in the database object.
- colLength
- Specifies the length of the
column.
- colType
- Specifies
the data type for the values in the column.
- isAlwaysGenCol
- Specifies whether the values in the column are always generated.
Acceptable values are true and false.
- isIdentityCol
- Specifies
whether the column is an identity column. Acceptable
values are true and false.
- isKey
- Specifies
whether the column is a key column. Acceptable values
are true and false.
- isUniqueColName
- Specifies
whether the column name is unique. Acceptable values
are true and false.
- isUserDefinedType
- Specifies
whether the type of the column is user-defined. Acceptable
values are true and false.
- name
- Specifies the
name of the column.
- tableName
- Specifies the name of the table to which the column belongs.
- connection
- The attribute of this tag specifies the name of the database connection
to use.
- name
- Specifies
the name of the database connection to use.
- field
- The tags within
this tag describe how a particular column in the
result set maps to a particular property of the bean for a single
result set.
- fieldInfos
- The tags within this tag describe how columns in the result set
map to properties of the bean for a single result set.
- interface
- importAnnotations
- Specifies the pureQuery annotations to import into the generated
interface. Acceptable values are as follow:
- import
com.ibm.pdq.annotation.Call;
- import
com.ibm.pdq.annotation.Select;
- import
com.ibm.pdq.annotation.Update;
- import
com.ibm.pdq.annotation.Handler;
- importTypes
- Specifies which Java types
to import. You must import all types that are not part of the java.lang.*
package.
- interfaceMerge
- If the specified name of the interface to generate matches the
name of a Java class that already
exists in the target Java project,
specifies to merge the contents of the existing class with the newly
generated interface.
- interfaceName
- Specifies the name of the interface to generate for the annotated-method
programming style.
- package
- Specifies the name of the Java package
in which to place the generated code.
- srcContainer
- Specifies the folder within the project in which to place the
generated code.
- parameter
- The attributes of this tag describe a particular property of the
bean.
- javaType
- Specifies
the Java data
type for the property of the bean.
- name
- Specifies the name of the property.
- parameterMode
- The constant that identifies the parameter as an IN, INOUT, or
OUT parameter. The constant is defined in the JDBC interface parameterMetadata.
- parameterType
- Specifies
the SQL type that corresponds to the Java type
of the parameter.
- procedure
- The attributes of this tag designate the stored procedure from
which to generate pureQuery code, as well as how to format the name
of the stored procedure in the resulting SQL statements.
- handlerClass
- If you want to use your
own CallHandlerWithParameters class
for processing the results of the stored procedure, specify the package
and class name. For information about CallHandlerWithParameter classes,
see The CallHandlerWithParameters<CAL> interface.
- includeSchemaInSQL
- Specifies
whether to include the schema in the generated SQL statements.
Acceptable values are true and false.
- name
- Specifies the
name of the stored procedure.
- schema
- Specifies the schema of the stored procedure.
- procParameters
- The
attributes of this tag describe the generated bean.
- genBean
- Specifies whether to create a new bean or whether the procParameters tag
describes an existing bean.
- true
- Create a new bean.
- false
- The bean tag describes an existing bean.
- genPublicFields
- Specifies the access level of the properties of the bean.
- A
value of true generates the properties of the bean as public.
- A
value of false generates the properties of the bean as protected
and allows access to them through get and set methods.
- importTypes
- Specifies
which Java types
to import.
- name
- Specifies
the name of the bean.
- package
- Specifies the name of the Java package
in which to place the generated code.
- srcContainer
- Specifies the folder within the project in which to place the
generated code.
- superClass
- Specifies the superclass of the bean.
- results
- This tags
within this tag describe the beans to generate for each
result set that the stored procedure can return.
- resultSet
- The tags within this tag
describe the generated bean for a single
result set.
- selection
- The attributes of this tag describe which pureQuery code is generated
with the help of this XML, as well as the wizard that initiates the
code generation.
- genAlwaysJUnit
- Specifies whether to generate test classes as JUnit test cases.
Acceptable values are true and false.
- genIncludeConn
- Specify
whether to include information about the database connection
in generated test classes. Acceptable values are true and false.
- genInlineSample
- Specifies
whether to generate a test class that uses the inline
programming style. Acceptable values are true and false.
- genInterface
- Specifies
whether to generate an interface that uses the annotated-method
programming style. Acceptable values are true and false.
- genInterfaceTest
- Specifies
whether to generate a test class that invokes the methods
in an implementation of the generated interface. Acceptable values
are true and false.
- genSampleUtil
- Specifies to
generate a class that contains static methods that
are called by the test classes when they run. These methods print
to the Console view the results from running the test classes. This
class also contains code for to establish database connections for
the test classes.
- genType
- Specifies that the Generate pureQuery Code from a Stored
Procedure wizard initiates the code generation.
- testCode
- importTypes
- Specifies
which Java types
to import. You must import all types that are not part of the java.lang.*
package.
- inlineSampleName
- Specifies the name to give to the generated test class for the
inline programming style.
- interfaceTestName
- Specifies the name of the test class for the annotated-method
programming style.
- package
- Specifies the name of the Java package
in which to place the generated code.
- srcContainer
- Specifies the folder within the project in which to place the
generated code.