Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-228

jberet-support BatchProperty injection is not spec compliant?

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 1.2.0.Final
    • None
    • None
    • Hide

      Use JSL like the following:

      ```xml
      <reader ref="org.jberet.support.io.JdbcItemReader">
      <properties>
      <property name="sql" value="select * from TABLE" />
      <property name="url" value="jdbc:url" />
      <property name="user" value="user" />
      <property name="password" value="password" />
      <property name="beanType" value="java.util.Map" />
      </properties>
      </reader>
      ```

      In other JSR-352 implementations, the reader will fail to be instantiated because the runtime cannot inject a String ("java.util.Map") into a field that is typed as a Class.

      Show
      Use JSL like the following: ```xml <reader ref="org.jberet.support.io.JdbcItemReader"> <properties> <property name="sql" value="select * from TABLE" /> <property name="url" value="jdbc:url" /> <property name="user" value="user" /> <property name="password" value="password" /> <property name="beanType" value="java.util.Map" /> </properties> </reader> ``` In other JSR-352 implementations, the reader will fail to be instantiated because the runtime cannot inject a String ("java.util.Map") into a field that is typed as a Class.

    Description

      Several utility reader/writers in jberet-support leverage JBeret's ability to @Inject @BatchProperty values that represent types other than Strings (e.g. [JdbcItemReaderWriterBase](https://github.com/jberet/jsr352/blob/master/jberet-support/src/main/java/org/jberet/support/io/JdbcItemReaderWriterBase.java#L58) as a particular example. While this support is useful, it means that these readers/writers may not work in other JSR-352 implementations (as I believe the spec reflects that only String injection must be supported).

      Changing these readers and writers to use String injection, than resolving the types via other utilities would make these readers/writer portable and useful in other contexts.

      Attachments

        Activity

          People

            weli@redhat.com Weinan Li
            sparty02 Ryan Dunckel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: