Hello,
I'm fairly new the Seam and looking for some advice on achieving the following:
Some tables (entities) in my application contain data that must be associated
with the user that created the record.
I got the part where the entities are annotated properly to describe the 1 to *
relationship.
The question I have is which one of the two following approaches Seam veterans
would recommend to use (or if neither are appropriate, what's the alternative).
Approach A would be to override the "persist" method in entityHome such as:
| public class myEntityHome extends EntityHome<MyEntity>
| {
| ...
| @In
| User user; // That's the entity with the user's data
|
| ...
| @Override
| public String persist() {
| this.getInstance().setSubmitter(user); // Recording who created
this using the entity's setter
| return super.persist();
| }
| }
|
Approach B would be to handle this in an "action" bean.
Thanks.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110025#4110025
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110025
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user