This is a unidirectional 1:m so yes you do need a relationship table. On 1/10/03 10:25 pm, "Harkness, David" <[EMAIL PROTECTED]> wrote:
> Trying to clarify... > > David Nielsen <mailto:[EMAIL PROTECTED]> once said: >> /** >> * @ejb:interface-method >> * @ejb:relation >> * name="MailMessages-toUser" >> * role-name="MailMessages-Has-toToUser" >> * target-ejb="Users" >> * target-role-name="toUser-belongs_to-MailMessages" >> * target-cascade-delete="yes" >> * @jboss:target-relation >> * related-pk-field="messageKey" >> * fk-column="messageKey" >> * @jboss:relation-table >> * table-name="MailMessages_toUsers" >> * create-table="true" >> * remove-table="true" >> ... >> jboss creates the mailmessages + the users table but no >> mailmessages_tousers table, and there now are a column (messagekey) in > >> users table. > > This is a unidirectional 1:N relation, correct? I ask because you don't > need a separate relation table to model 1:N -- only for N:M. And if it's > N:M, "toUser" is actually a Collection, and the role-name would be > "MailMessages-Have-Many-toUsers". > > Though this shouldn't matter, the role-name has a typo. It should be > "MailMessages-Has-toUser", not "toToUser". Regardless, can you provide a > bit more detail here, perhaps including the schema and a description of > the relation itself. I'm finding it difficult to apply my intuition when > the names don't match up with my expectations. > > For example, you use "MailMessages" and "Users", yet I expect that they > actually represent single objects. A "Users" is a single user, and each > may have zero-or-more "MailMessages"s. I realize, though, that many > people name their DB tables with plurals (users_t vs. user_t). I just > want to make sure so we can help you better. > > David Harkness > Sr. Software Engineer > Sony Pictures Digital Networks > (310) 482-4756 > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > xdoclet-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
