Hello,
I am currently reading the Apress-book 'Beginning
EJB 3 application development, from novice to professional' and 'PRO EJB 3 API ...' from the same company.
The examples are not that good in those two books, the authors were probably in a hurry and did not get everything into the books.
I am using jdk 1.5 and
JBoss 4.2.1 if that should matter.
One thing that I cannot make happen, is how to Add an Item to a @ManyToMany - relationship. The key
word is 'Add' here.
Found an example
<a href="http://www.j3ltd.com/articles/ejbrels/EJBRelationships.htm</a rel="nofollow">" target="_blank">http://www.j3ltd.com/articles/ejbrels/EJBRelationships.htm[/url]
but the exmample crashes in more than one location.
The relationship is ;
Homes has many Persons, and a Person can have many Homes.
The tables are simple HOME has an 'ID' and a 'STREETADDRESS', PERSON has
an 'ID' and a 'NAME', a middle table is created HOMEPERSONS ( with PK from HOME and PK from PERSON). All tables are created.
There are 2 Entity-beans, Home and Person.
The Home-bean has the following statement (excluding all others ):
and Person has the following statement (excluding all others ):
The example states that we only need to do the following to add Home and a Person and that the middle-table is filled in some way.
This is their example:
Am I doing something wrong, or are they missing something important at 'www.j3ltd.com' ?
Hope that you can help me out here, cannot consider myself being able to handle this technique if I do not know how to insert a @ManyToMany.
best regards, i