Life/Asia table struct copybook convert to java pojo automaticlly
来源:互联网 发布:snare for windows 编辑:程序博客网 时间:2024/06/10 02:35
For My English Writing Practice(I know,Very poor)..
Technique Solution Overview
First of all, We should retrive the table struct. But how can we achieve it? Since the Life/Asia table struct is build by display screen file by SMART commad: CB SXXX XDS. So we can retrive all screen(or table) fields by AS400 Command DSPFFD FILE(SXXX ) OUTPUT(*FILE) FILEOPT(*FIRST *ADD).
After we get the table fields, you can make following consequence steps now.
(1)Resort them .(Fields in table struct copybook are sorted in ascending order)
(2)Create java pojo by table fields with FreeMarker . We can read logical file fldd to determinate the field type and length. Pojo name is TXXXXRecjava.
(3)Create a RFML file to map the table fields with FreeMarker. RFML file name = TXXXXREC.rfml
(4)Create a RFML Parase program, which can convert string(item.genarea) to java pojo with the help of RFML. File name = TXXXXRecOParase.java. Bean name = tXXXXRecOParase.
(5)Create a helper class ItemRead with cacheable function.
@Component("itemRead")
public class ItemRead{
@Cacheable..
public <T> T read(String company,String table,String item,String seq,Class<T> classOfT){
Item item = ItemReader.read(company,table,item,seq);
String beanName = String.uncaplize(table) + "RecOParase";
RfmlOParse<T> rfmlOParse = (RfmlOParse<T>) SptringUtil.getBean(beanName);
return rfmlOparse.parse(item.getGenarea());
}
(6) Snip Code
T5679Rec t5679Rec = itemRead.read("2","T5679","T512","",T5679Rec.class);
- Life/Asia table struct copybook convert to java pojo automaticlly
- Generate DB2 table definition COPYBOOK
- java.lang.NoSuchMethodException: com.asia.pojo.User.<init>()
- ASC Table, Convert String to Hex String
- How to convert CSV into Database Table?
- SQL 2008 Convert Xml to Table
- Oracle Table Relationship SQL of Procure To Pay Life Cycle
- java po vo to bo pojo dao
- error C2664: 'GetPartitionInfo' : cannot convert parameter 2 from 'struct a*' to 'struct a&'
- Java : how to convert text to image
- Java: How to convert int[] to byte[]
- Convert HTML Table to an Array in Python
- 【Java App Convert to EXE File】
- Convert a Java OutputStream to an InputStream
- Convert a Java OutputStream to an InputStream
- Convert a Java OutputStream to an InputStream
- Convert a Java OutputStream to an InputStream
- convert Java object to / from JSON
- [转载]C# 写Windows服务程序
- 解决全屏UI中输入法的问题(一)
- POJ 1703 Find them, Catch them
- Android开发_viewpager作为header加入到listview
- 一套非常适用权限系统快速开发框架源代码
- Life/Asia table struct copybook convert to java pojo automaticlly
- 经典回顾超炫酷阅读效果3D Book使用方法
- Algorithmic Implementation series(8) Implementation of Counting_Sort
- 均值、中值滤波、孤点检测
- 在linux使用RAR
- BAT
- java.sql.Date java.util.Date String 之间的转换
- web用户控件实现注册功能+前台验证
- Java SE 自学笔记8 之 final修饰符