-
1. Re: Many-to-Many relationship with cmp
ryanramage Nov 20, 2001 11:11 PM (in response to dharfleet)I am having the same problem. Any solutions yet?
-
2. Re: Many-to-Many relationship with cmp
foglesa Nov 21, 2001 12:10 AM (in response to dharfleet)In ejb 1.1 im not even sure I would use an entity bean for the user_role table. Of course if you are feeling adventurous you could look at jboss 3 alpha and use CMP2 with the relationships to do this much easier.
The overhead of an entity bean for a mapping table just doesnt make sense to me really in 1.1. Of course IMHO the or mapping in 1.1 was/is lacking anyway.
Al -
3. Re: Many-to-Many relationship with cmp
erik777 Nov 21, 2001 10:44 AM (in response to dharfleet)I created a UserRole CMP. While I understand that 1.1 is lacking, I am counting on being able to upgrade it to 2.0 when JBoss 3 is ready. Believe me, I am waiting anxiously for 3.0.
Here's the bean:
[pre]
public class UserRoleBean extends BaseCMPBean {
// Private persistent properties
public Integer userId, roleId ;
/**
* Create an instance of a bean. Note that this method returns null because the real
* creation is managed by the EJB container.
*/
public Integer ejbCreate (Integer _userId, Integer _roleId )
{
setUserId(_userId);
setRoleId(_roleId);
return null;
}
public void ejbPostCreate(Integer _userId, Integer _roleId ) { }
public Integer getUserId() { return userId; }
public void setUserId(Integer _userId) { userId = _userId; }
public Integer getRoleId() { return roleId; }
public void setRoleId(Integer _roleId) { roleId = _roleId; }
}
[/pre] -
4. Re: Many-to-Many relationship with cmp
foglesa Nov 21, 2001 5:15 PM (in response to dharfleet)well it is out... :)
Here is the link.
http://prdownloads.sourceforge.net/jboss/jboss-3.0.0alpha.zip
Al -
5. Re: Many-to-Many relationship with cmp
kantek Apr 10, 2002 5:06 PM (in response to dharfleet)But if i don't want a EJB to make the binding between the 2 entities ? How i do this ?