This content has been marked as final.
Show 4 replies
-
1. Re: bijection for entity beans
gavin.king Oct 8, 2005 3:34 PM (in response to patrick_ibg)Yes, this is by design, the domain model should not be dependent upon application logic, because the domain model is shared and changes much less often.
Also, entity beans are often instantiated by the application instead of by Seam, and Seam can not then intercept them. -
2. Re: bijection for entity beans
tom_goring Oct 10, 2005 3:16 PM (in response to patrick_ibg)"gavin.king@jboss.com" wrote:
Yes, this is by design, the domain model should not be dependent upon application logic, because the domain model is shared and changes much less often.
Also, entity beans are often instantiated by the application instead of by Seam, and Seam can not then intercept them.
Hi All,
What would be the best way then to ensure all domain objects when updated get the user id of the user in the session. BiInjection seems a good way to me.
Thanks in advance. -
3. Re: bijection for entity beans
rdewell Oct 10, 2005 11:07 PM (in response to patrick_ibg)Tom, maybe you could try something like:
@PreUpdate
public void updateMyUserId(){
MySessionBeanInterface b = Component.getInstance(MySessionBean.class, true);
this.setUserId(b.getCurrentUserId());
}
The "Component" class is a Seam class: org.jboss.seam.Component. Basically, you're mainly performing the "injection" / object lookup programmatically.
Ryan -
4. Re: bijection for entity beans
gavin.king Oct 11, 2005 5:50 AM (in response to patrick_ibg)IMO, the best way is to do all that kind of thing from that action listener method.