For our grails application, I've written a method that lets you upload a CSV file full of contacts, and it will parse the file and create contacts out of the data. I've used a test file of my own (hard-coding which fields mean what) and it works great.
But of course I can't leave the field references hard-coded like that, so my next step is to show the user a screen letting them map the columns in their file to our database fields (columns A and B hold names, column C holds e-mail, etc).
My question: what's the best way to temporarily store the data I extract in the first part, so it can be used at the end of the second? A domain class would seem like the logical choice, but I haven't found a graceful way to do this at all. Hibernate doesn't seem to be fond of 2D string arrays, and to implement it in an OO fashion would require several domain classes (ImportedCsv, CsvRow). Is that acceptable to have several top-level domain classes for such a small and temporary process?
I'm a bit of a grails newbie, so I'm not sure what's hackish and what's graceful. What would you do?