db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mark.l...@talk21.com>
Subject Re: foreign keys and addMyObj method
Date Tue, 12 Aug 2003 14:22:56 GMT

oops.. I wrote that i've been trying

AppicationPeer.addApplicant(app);

but i've been trying the correct

application.addApplicant(app);

just in case any jumps on that quick..


On Tuesday, August 12, 2003, at 03:17 PM, Mark Lowe wrote:

> Hello
>
> I just want to double check my thinking on how this works, because 
> something isn't happening for me..
>
>
> Okay I've a schema in which i've defined my foreign keys, for example.
>
> <table javaName="Applicant" name="APPLICANT">
> //bla bla
>
> <column name="APPLICATION_ID" type="INTEGER" javaName="ApplicationId" 
> />
>
> <foreign-key foreignTable="APPLICATION">
> 			<reference local="APPLICATION_ID" foreign="APPLICATION_ID"/>
> </foreign-key>
> </table>
>
>
> <table javaName="Application" name="APPLICATION">
> 		<column name="APPLICATION_ID" primaryKey="true" required="true" 
> type="INTEGER" autoIncrement="true" javaName="Id" />
>
> The idea being to allow multiple applicants per application..
>
> Now when I want to save my application
>
> Applicant appicant = new Applicant();
>
> //i'm not using beanUtils but for the sake of brevity
>
> BeanUtils.copyProperties(applicant,applicantBean);
>
> ApplicationPeer.addApplicant(applicant);
>
> //save or doInsert() from the peer I've been trying both
> applicant.save();
> application.save();
>
>
> These are saved to the DB just applicationId in my applicant table 
> isn't doing its thing..
>
> Any ideas? Or am i just doing it wrong?
>
> Cheers Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message