Looking for a Data Binding Platform that can ...

Discussions

EJB programming & troubleshooting: Looking for a Data Binding Platform that can ...

  1. Looking for a Data Binding Platform that can ... (3 messages)

    I am currently searching for a Data Binding platform that will help me do the following:

    Bind data from a table like this:

    Group Article Price
    --------------------------
    G1 A 3
    G1 A 4
    G1 B 5
    G2 A 6

    ... into a 'resultSet' ArrayList as follows (where the => connects a key/value pair):

    ArrayList{
    0 => HashMap
    {
     'name' => 'G1'
     'Article' => ArrayList
     {
      0 => HashMap
      {
       'name' => 'A'
       'Price' => ArrayList
          {
            '3'
            '4'
          }
      }
      1 => HashMap
      {
       'name' => 'B'
       'Price' => ArrayList
          {
            '5'
          }
      }
    }
    1 => HashMap
    {
     'name' => 'G2'
     'Article' => ArrayList
     {
      0 => HashMap
      {
       'name' => 'A'
       'Price' => ArrayList
          {
            '6'
          }
      }
    }
    }

    I'm making the change to java from php, so please excuse the weird syntax and strange request.

    I've taken a look at Castor and OJB, but I'm not quite sure if they'll do the trick.

    Anybody out there have any ideas?

    Thanks,

    Cae
  2. I doubt you are going to find a tool that can handle these strange requirements. Most Data Binding tools in Java are object-oriented, and bind data to specific classes, not maps. The few tools that I know of that use maps are very generic.

    I suggest you hack this code out yourself. The logic should not be all that hard using JDBC and basic logic.

    1) Use JDBC to get your result set.

    2) Iterate through your result set, try to insert the data in the appropriate location, creating an ArrayList/HashMap structure with the appropriate names if none exists.
  3. hmmm[ Go to top ]

    I was fearing someone would say something like that. Oh well, then I'll just have to hack it out. Thanks anyway. Cae
  4. hi ,

    I did a DATABINDING (probably first java databinding api used in production environment) API in 1998 in swing. I developed Fedex Shipping software with it. They were using it for 3 years then scratched it as no one to develop further the api as i left that department.

    You can map to any Swing Controls. Actually it is more powerful api that it can MAP any XML file. it just have to find different reader.

    The only thing it is very old. Almost 6 years passed. if you are very interested in developing from scratch, i will help you.

    Actually i am interested in developing it to full blown API plugin in client PC'S to read XML data from web services.

    email me at Alexkumar at hotmail dot com if you are interested.