pradeepsjsu / beanio

Automatically exported from code.google.com/p/beanio
Apache License 2.0
0 stars 0 forks source link

Errors when not all records on stream have RID #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?  If applicable, please provide a
mapping configuration and sample record input to recreate the problem.
1. Create c BeanIO configuration with header and trailer RID
2. Detail record may not have RID

What is the expected output? What do you see instead?
If BeanIO does not find a record definition which does match a RID, the 
framework should try using the next record definition which does not have RID 
attribute

What version of BeanIO are you using? What JDK version?
BeanIO 1.2.2

Please provide any additional information below.
See attached files

Original issue reported on code.google.com by mikhas.rock on 13 Jan 2012 at 6:20

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Mikhas, I see what you mean, but I don't think BeanIO should assume it has 
the wrong record type if a record doesn't pass validation.

In your specific example, I would use a regular expression to identify detail 
records based on a numeric processDate field, as shown below.  (I simply added 
rid="true" and regex="\d+")

<field name="processDate" rid="true" regex="\d+" length="9" type="date" 
justify="left" format="yyyyMMdd"/>

Original comment by kevin.s...@gmail.com on 14 Jan 2012 at 4:00

GoogleCodeExporter commented 9 years ago

Original comment by kevin.s...@gmail.com on 14 Jan 2012 at 4:05