Based on your schema below, torque will generate methods like:
Project.getProjectUsers(Criteria)
and
User.getProjectUsers(Criteria)
you can use these methods to build better named methods, similar to
this:
Project.java
public List getUsers(Criteria crit)
{
List pus = getProjectUsers(crit);
List users = new ArrayList(pus.size());
Iterator i = pus.iterator();
while (i.hasNext())
{
users.add( ((ProjectUser)i.next()).getUser() );
}
return users;
}
john mcnally
On Thu, 2002-05-09 at 03:11, Sebastian Galonska wrote:
> Hello group,
>
> as a newbie with Torque I would like to know how it is possible to use n:m
> relations.
> Let�s quickly come to terms. I�ve got these classes for example:
>
> class businessObject {
> public int id; // primary key
> // ... more attributes
> }
>
> class Project extends businessObject{
> public HashSet myPersons;
> // ... more attributes
> }
>
> class Person extends businessObject {
> String name;
> String surname;
> // ... more attributes
> }
>
> It is recommended that several persons can belong to several projects. So I
> created the following tables:
>
> ================
> table Project:
> ---------------------
> id: int
> ...
> ================
> Table Person:
> ---------------------
> id: int
> name: text
> surname: text
> ...
> ================
> Table Project_Person:
> ---------------------
> oid_project: int
> oid_person: int
>
> How to access the Persons that are involved in a project?
> Another question is about how to implement transactions with Torque. How
> can I initiate and how can I finalize a transaction?
> Is Torque capable to meet my needs? (Hope yes ;-)).
>
> Thank you vor your help
>
> best regards
> Sebastian
> --------------------------------
> Sebastian Galonska
> Ritterstrasse 96
> 10969 Berlin
> GERMANY
>
> phone: +49 30 61107231
> mobile: +49 177 8806060
> fax: +49 30 61107232
>
> ICQ#: 11524202
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>