Does user.addRole(role) call role.addUser(this)? If not maybe that's 
something to try to solve your problem?
Gerhard





"Hiu Yen Onn" <[EMAIL PROTECTED]>
17.10.2003 02:00
Bitte antworten an "OJB Users List"

 
        An:     <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
        Kopie: 
        Thema:  Re: non-decomposed m:n mappings problem......


public void testCreateUser() throws Exception{
 
                 IUserDelegate impl = 
DelegateFactory.getInstance().createUserDelegate();
                 User view = null;
                 //simple benchmark 
                 long start = System.currentTimeMillis();
                 try{
                                 view = impl.createDoc(createSite(), 
createUser()); 
                 }catch(BDException e){
                                 System.out.println(e.getMessage());
                 }
                 long stop = System.currentTimeMillis(); 
                 System.out.println("Performance: " + (stop - start) + " 
msec"); 
 
                 System.out.println("Result: " + view.toString());
 
}

public static User createUser(){
                 User user = new User();
                 user.setLabel("yenonn");
                 user.setDesignation("programmer");
                 user.setFullName("Hiu Yen Onn");
                 user.setPassword("yenonn");
                 for(int i=0; i<3; i++){
                                 Role role = new Role();
                                 role.setLabel("role"+i);
                                 role.setRoleName("syl-admin");
                                 role.setAllowCreate(1);
                                 role.setAllowDelete(1);
                                 role.setAllowEdit(1);
                                 role.setAllowSearch(1);
                                 user.addRole(role);
                 }
                 return user;
}

public static Site createSite(){
                 Site site = new Site();
 
                 site.setSiteId("syweb"); 
                 site.setName("Shin Yang HQ");
                 site.setDbConnectionAlias("syweb"); 
                 site.setDefaultSite(new Boolean(true));  
                 //site.setJndiProviderUrl("jnp://172.16.0.252:1099");    
                 site.setJndiProviderUrl("127.0.0.1");
                 return site; 
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to