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

icordoba do-not-reply at jboss.com
Fri Aug 10 10:46:10 EDT 2007


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



More information about the jboss-user mailing list