Announcement Announcement Module
Collapse
No announcement yet.
Data from multiple inputs for a single item Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data from multiple inputs for a single item

    Hi all, I have a problem I haven't yet found a solution for.

    I have one object to be built from multiple files. For instance:

    Code:
    Class MyObject
      - Property MyPropertyA
      - Property MyPropertyB
      - Property MyPropertyC
      - Property MyPropertyD
    Now let's say I have three input files:

    Code:
    InputFileA.csv
    InputFileB.csv
    InputFileC.csv
    I would have to read lines from all three files to create MyObject, let's say as follows:

    Code:
    MyPropertyA : InputFileA (line 13, field 4)
    MyPropertyB : InputFileB (line 11, field 7)
    MyPropertyC : InputFileC (line 5, field 2)
    MyPropertyD : InputFileC (line 6, field 2)
    Each of the records in these files would have a common identifier to enable the relationship to be built, say an ID number in field 1 of each file.

    Is this possible with Spring or am I asking too much?


    Cheers,
    Jordan

  • #2
    Hi Jordan,

    I am not a spring expert but i have worked a lot in plain java, and that looks a quite simple task to do in plain java without the need of a framework.

    If i wanted to use Spring for this maybe an option i think is that you could load those files to tables in a database and use Hibernate+Spring to simplify the coding.
    As csv files can be easily loaded into a database table from inside a java class or from outside (as you wish).

    Cheers,
    Martin.

    Comment

    Working...
    X