Hibernate mapping help

Discussion in 'Java' started by venu, Jan 13, 2006.

  1. venu

    venu Guest

    I have two classes and two tables as shown below and I need help in
    mapping them using hibernate,

    class User
    {
    Long id;
    String firstName;
    String lastName;
    UserDynAttributes dynAttributes;
    }

    class UserDynAttributes {
    private Map attributes;
    }

    Table User ( id, firstName, lastName);

    Table UserDynAttributes(id, the fields in this table are customizable)

    The attributes member contains a map of column names and their values,
    for example if the
    attributes contains {(profession ->doctor), (country->XYZ)} I should
    map them to table UserDynAttributes (id, profession, country).


    Also, when I retrieve UserDynAttributes object from the database, it
    should contain all the columns in the table mapped to java Map.


    Has anyone done something like this in Hibernate?

    Regards,
    Venu
     
    venu, Jan 13, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ilias Lazaridis
    Replies:
    0
    Views:
    1,773
    Ilias Lazaridis
    Dec 27, 2004
  2. Replies:
    0
    Views:
    3,808
  3. shaji
    Replies:
    3
    Views:
    24,639
    shaji
    Aug 30, 2005
  4. anita
    Replies:
    0
    Views:
    350
    anita
    Mar 14, 2006
  5. jstorta
    Replies:
    1
    Views:
    11,847
Loading...

Share This Page