>What do you want said?
>Where are they testcases?
in src\test\ there are many testcases.
>In the OJB there aren't samples with classes,
>only samples of description (XML, etc).
>
>We need classes samples using N:N mapping, understand?
What do
src\test\org\apache\ojb\odmg\ManyToManyTest.java,
src\test\org\apache\ojb\broker\ManyToManyTest.java,
and
src\test\org\apache\ojb\broker\MToNMapping.java.
look like ? They are test cases for many to many mapping. I believe there
may be more, but I can't be bothered to look for them for you. Jakob told
you what to look for.
>Alex, Tiago and Juliano
>
> --- Jakob Braeuchi <[EMAIL PROTECTED]> escreveu: > hi
>,
>>
>> have a look at the testcases using person and
>> project.
>> these samples are part of ojb.
>>
>> jakob
>>
>> ----- Original Message -----
>> From: "Qualita" <[EMAIL PROTECTED]>
>> To: "Lista OJB" <[EMAIL PROTECTED]>
>> Sent: Friday, September 06, 2002 8:44 PM
>> Subject: BUG mapping n:n OJB
>>
>>
>> > Hi,
>> >
>> > Somebody knows a simple example of OJB application
>> > that has supported mapping N:N? It would be
>> possible
>> > to divulge for us?
>> >
>> > In attach it is our example based on tutorial 3
>> that
>> > have problems.
>> >
>> > In the class UCEnterNewRole, we use class/object
>> > intermediate (role) and only this object is store
>> in
>> > the DB, but the others not.
>> >
>> > In the class UCEnterNewRole1, we don't use
>> > class/object intermediate and then only this is
>> not
>> > store. Somebody can help us?
>> >
>> > Thanks,
>> >
>> > Alex / Tiago
>> >
>> >
>>
>_______________________________________________________________________
>> > Yahoo! PageBuilder
>> > O super editor para cria��o de sites: � gr�tis,
>> f�cil e r�pido.
>> > http://br.geocities.yahoo.com/v/pb.html
>>
>>
>>
>---------------------------------------------------------------
>-------------
>> ----
>>
>>
>> > //package test.ojb.tutorial1;
>> >
>> > import org.apache.ojb.broker.PersistenceBroker;
>> > import
>> org.apache.ojb.broker.PersistenceBrokerException;
>> >
>> > /**
>> > * Insert the type's description here.
>> > * Creation date: (04.03.2001 10:34:15)
>> > * @author: Administrator
>> > */
>> > public class UCEnterNewRole extends
>> AbstractUseCase
>> > {
>> > /**
>> > * UCEnterNewProduct constructor comment.
>> > */
>> > public UCEnterNewRole(PersistenceBroker
>> broker)
>> > {
>> > super(broker);
>> > }
>> >
>> > /** perform this use case*/
>> > public void apply()
>> > {
>> >
>> > //Insert the Person
>> > Person newPerson = new Person();
>> > // now read in all relevant information
>> and fill the new object:
>> > System.out.println("please enter a new
>> person");
>> >
>> > String in = readLineWithMessage("enter ID
>> :");
>> > newPerson.setId(Integer.parseInt(in));
>> > in = readLineWithMessage("enter First
>> name:");
>> > newPerson.setFirstname(in);
>> > in = readLineWithMessage("enter Last
>> name:");
>> > newPerson.setLastname(in);
>> >
>> >
>> > //Insert the Project
>> > Project newProject = new Project();
>> > // now read in all relevant information
>> and fill the new object:
>> > System.out.println("please enter a new
>> Project");
>> > in = readLineWithMessage("enter ID :");
>> > newProject.setId(Integer.parseInt(in));
>> > in = readLineWithMessage("enter Title:");
>> > newProject.setTitle(in);
>> > in = readLineWithMessage("enter
>> Description:");
>> > newProject.setDescription(in);
>> >
>> >
>> > // this will be our new object
>> > Role newRole = new Role();
>> > // now read in all relevant information
>> and fill the new object:
>> > System.out.println("please enter a new
>> Role (n:m)");
>> > in = readLineWithMessage("enter PERSON_ID
>> :");
>> >
>> newRole.setPerson_id(Integer.parseInt(in));
>> > in = readLineWithMessage("enter PROJECT_ID
>> :");
>> >
>> newRole.setProject_id(Integer.parseInt(in));
>> >
>> > in = readLineWithMessage("enter Role
>> name:");
>> > newRole.setRoleName(in);
>> >
>> > newRole.setProject(newProject);
>> > newRole.setPerson(newPerson);
>> >
>> > // now perform persistence operations
>> > try
>> > {
>> > System.out.println("Dentro do try");
>> >
>> >
>> System.out.println(newRole.getRoleName());
>> >
>> > if (newRole == null)
>> System.out.println("Eh null");
>> >
>> > System.out.println(newRole);
>> > // 1. open transaction
>> > System.out.println("1");
>> > broker.beginTransaction();
>> > System.out.println("2 , antes do store");
>> > // 2. make the new object persistent
>> >
>> > broker.store(newProject);
>> >
>> > System.out.println("3");
>> > broker.commitTransaction();
>> > }
>> > catch (Exception ex)
>> > {
>> > System.out.println("ERRO ->"+ex);
>> >
>> > // if something went wrong: rollback
>> > broker.abortTransaction();
>> > System.out.println(ex.getMessage());
>> > ex.printStackTrace();
>> > }
>> > }
>> >
>> > /** get descriptive information on use case*/
>> > public String getDescription()
>> > {
>> > return "Enter a new Role (n:m)";
>> > }
>> > }
>> >
>>
>>
>>
>---------------------------------------------------------------
>-------------
>> ----
>>
>>
>> > //package test.ojb.tutorial1;
>> >
>> > import org.apache.ojb.broker.PersistenceBroker;
>> > import
>> org.apache.ojb.broker.PersistenceBrokerException;
>> > import org.apache.ojb.broker.*;
>> > /**
>> > * Insert the type's description here.
>> > * Creation date: (04.03.2001 10:34:15)
>> > * @author: Administrator
>> > */
>> > public class UCEnterNewRole1 extends
>> AbstractUseCase
>> > {
>> > /**
>> > * UCEnterNewProduct constructor comment.
>> > */
>> > public UCEnterNewRole1(PersistenceBroker
>> broker)
>> > {
>>
>=== message truncated ===
>
>_______________________________________________________________________
>Yahoo! PageBuilder
>O super editor para cria��o de sites: � gr�tis, f�cil e r�pido.
>http://br.geocities.yahoo.com/v/pb.html
>
>--
>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.
At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk. All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to
HPD Software Limited or its affiliates.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>