Preserving your changes to the Java XOM when the z/OS data model is updated
You can add code to a generated Java™ XOM and keep the changes when the z/OS® data model (COBOL copybook or PL/I include file) is updated by enclosing that code inside user code tags.
About this task
Attention: If
the mapping name of a Java class
has changed when you update the Java XOM,
for example, the Borrower class is renamed to CoBorrower,
then the original Java class Borrower is
deleted, including your added code.
Procedure
Example
The following example is based on a COBOL data model.
In the following Loan class, a new method is added to parse a Date object from a String type attribute "effectDate". This method can then be used to perform the following tasks:
- Include the required String to Date conversion libraries between user import tags
- Include a parseEffectDate() method between user code tags to handle the String to Date conversion
package xom;
import ilog.rules.bom.annotations.CustomProperties;
import java.util.List;
//@USER_IMPORT_BEGIN
import java.util.Date;
import java.text.*;
//@USER_IMPORT_END
@CustomProperties(names = {"cobol_type"}, values = {"true"})
public class Loan {
private long amount;
private String effectDate;
private String approved;
public Loan() {
}
......
......
//@USER_CODE_BEGIN
public Date parseEffectDate() {
.....
DateFormat format = new SimpleDateFormat("yyyyMMdd");
......
Return format.parse(this.effectDate);
}
//@USER_CODE_END
}