-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: can save childset on saving a object by object.setSetX(chi
PostPosted: Mon May 09, 2005 3:14 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
can save childset on saving a object by object.setSetXXX(childset)




public void testSave() {

SaveAccessRuleTemplateView model = new SaveAccessRuleTemplateView();
model.setTitle("hhhhhhhhh");
model.setEnabled(Boolean.TRUE);

String tacheArray[] = new String[1];
tacheArray[0] = "ROLE_XFILE";

model.setTache(tacheArray);

AccessRuleTemplate template = new AccessRuleTemplate();
template.setTitle(model.getTitle());
template.setNote(model.getNote());

if ((model.getEnabled() == null)
|| (!model.getEnabled().booleanValue())) {
template.setEnabled(Boolean.FALSE);
} else {
template.setEnabled(Boolean.TRUE);
}


//Set taches = new Set();
//Set taches = new net.sf.hibernate.collection.Set();
Set taches = new HashSet();
for (int i = 0; i < model.getTache().length; i++) {
RoleDefiniens role = new RoleDefiniens();
role.setSymbol(model.getTache()[i]);

AccessRuleTache tache = new AccessRuleTache();
tache.setOrderNo(new Integer(i));
tache.setRoleDefiniens(role);
tache.setAccessRuleTemplate(template);
}
template.setSetOfAccessRuleTache(taches);

System.out.println("aaaaaaaaaaaaaaaaaaaaaaa");

accessRuleTemplateDao.save(template);
}

_________________
I am the creatxr of world.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 09, 2005 3:49 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
I'm OK now.

I made a mistake. sorry

_________________
I am the creatxr of world.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.