Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [EJB 3.0] - Re: Working example por OneToMany cascade
 remove?

scott.stark@jboss.org

2007-08-10


Hi there,
thanks a lot for your reply... this is the Portal side:

 @OneToMany(mappedBy="portal",fetch=FetchType.LAZY, cascade={CascadeType.ALL})
|  public void setUsers(Set<User> users)
|  {
|    this.users = users;
|  }
|
|  @OneToMany(mappedBy="portal",fetch=FetchType.LAZY, cascade={CascadeType.ALL})
|  public Set<User> getUsers()
|  {
|    return users;
|  }
|

and this is the user side:


|  @ManyToOne
|  public Portal getPortal()
|  {
|    return portal;
|  }
|
|  @ManyToOne
|  public void setPortal(Portal portal)
|  {
|    this.portal = portal;
|  }
|

Does it look right?

Ignacio

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073081#4073081

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073081
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.