Dear,
i'm trying to map some class in hibernate but I'm having difficult with this.
I have 3 tables in my DB: access, users and level. The access table has 3 columns where one field has a relation with the users table and other field with the level table, it defines the level of user.
So, I have 2 class for the users table: Administrator and User and I need to map the users table, depending of level table. I didn't obtain a result for it. I tried to use in my mapping the tag <joined-subclass> in my Access.hbm.xml with a descriminator for to differentiate the Administrator class when level will be 2 and User class when level will be 1.
How do I make it?
Fields of my tables:
access: id, id_user and id_level
level: id and name
user: id and name
Ask me any question if necessary.
Thx a lot for all.
Sorry for my poor english.
|