Hi everybody,
   I am new to AndroMDA. I am using it in a sample project with Hibernate and PostgreSQL.
 
   I tried to create two sample tables and experiment with them.
     Table 1: Roles -- Which stores the Roles ("Management","Account",etc )
     Table 2. UserRoles - Which stores the Roles allotted to a particular role
     Table 3. Users - Which stores the details of the user.
 
What I want to specify  many-to-one relationships between UserRole and User and between UserRole and Role.
   When I worked on this relationships the following XDoclet entries are generated in UserRole.java
 /**
     *
     *
     * @hibernate.many-to-one
     *     column="ROLE_FK"
     *     class="Role"
     */
private Role role;
 /**
     *
     *
     * @hibernate.many-to-one
     *     column="J_USER_FK"
     *     class="JUser"
     */
private User user;
 
 When I studied the database, the table related to the UserRole stored the associated ids of the Role and User in the column ROLE_FK and J_USER_FK.
 
I have some doubts.
1. Why does the Hibernate choosed to store ids of the associated records?
2. Does this type of mapping results in poor performance when compared with the following code that I want AndroMDA to generate?
 
 /**
     *
     *
     * @hibernate.many-to-one
     *     name="role"
     *     column="ROLE_FK"
     *     class="Role"
     */
   private String role;
 
/**
     *
     *
     * @hibernate.many-to-one
     *      name="user"
     *     column="J_USER_FK"
     *     class="JUser"
     */
private String user;
 
I want to store in "role" and "user" only the ids of the Role and the User respectively.
3. Will doing so yield any additional performance improvement?
4.  If the above approach results in greater performance, how can I tell AndroMDA to do the same?
 
Thank you,
Kishore.
 


Do you Yahoo!?
Make Yahoo! your home page

Reply via email to