oh, I am sorry. I should read posts more carefully.
Please forget my post. But I still thik this is not a good way around.

regards - michal

Louis Moore wrote:

I understand matthew's problem. using a foreign key
will, in fact, generate getUserProfile(). each entry
in the EXTENDED_USER table will have exactly ONE
foreign key to the USER_PROFILE table and torque will
generate the getUserProfile() function which will
return the ONE associated profile. i would suggest
trying this method.


your schema should look something like this:

<table name="EXTENDED_USER">
 .
 .
 <column name="USER_PROFILE_ID" type="INTEGER"/>
 .
 .
 <foreign-key foreignTable="USER_PROFILE">
   <reference local="USER_PROFILE_ID"
foreign="USER_PROFILE_ID"/>
 </foreign-key>
</table>

-Lou

--- Michal Frackowiak <[EMAIL PROTECTED]> wrote:


Louis Moore wrote:



You can add a USER_PROFILE_ID field to your
EXTENDED_USER table and make it a foreign key to


the


USER_PROFILE table. Then torque should autogenerate
the getUserProfile() function i believe.



no, it will generate getUserProfiles(). and that is
not Matthew's problem but rather getting only ONE profile with
getUserProfile().
Matthew - see my answer above.... you can implement
this method in ExtendedUser. That is how I do such things.


regards - michal



-Lou

--- Matthew Pomar <[EMAIL PROTECTED]> wrote:




Is there anyway to use Turbine (Torque) to create


a


one-to-one mapping in
the database schema? I'm extending the


TURBINE_USER


per instructions on
Turbine site:






http://jakarta.apache.org/turbine/turbine-2.2.1/howto/extend-user-howto.html






But instead of creating over 25 new columns in the
user table, I'm create a
new USER_PROFILE table with all the additional
information. What I'm facing
now is this:

ExtendedUser user = (ExtendedUser)data.getUser();
UserProfile profile =
(UserProfile)user.getUserProfiles().get(0);

There is only 1 profile for 1 user - one to one.
Instead of the above code,
I would like to do this:

ExtendedUser user = (ExtendedUser)data.getUser();
UserProfile profile = user.getUserProfile();

Can anyone tell me how to accomplish this without
extending the ExtendedUser
class?

Thanks






---------------------------------------------------------------------






To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]





__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site


design software


http://sitebuilder.yahoo.com



---------------------------------------------------------------------


To unsubscribe, e-mail:


[EMAIL PROTECTED]


For additional commands, e-mail:


[EMAIL PROTECTED]










---------------------------------------------------------------------


To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]





__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to