On 21 October 2010 11:24, marc <[email protected]> wrote:

> If I want to get an object that is spanned over several tables (via
> onetomany or manytoone) I can use get(cass,key) where key is the value
> of a property in the class object.
> Can I also retrieve an object from class using te value of a key in a
> related table?
>
> So say I have a table
> newspaper
>  - id
>  - name
>  - price
>  - FK_language
>
> and a table
> language
>  - id
>  - name
>  - title
>
> I understand I can't use a get() to retrieve all newspapers in a given
> language (since it may return more than one). I also can't use list()
> or one of it's varieties since that only queries 1 single class. So is
> my only option here to write a TQL query and use list()?
>
>
Marc,

How have you set up the relationship between newspaper and language in your
transfer.xml file?

If you have a onetomany from language to newspaper, you can use the
generated methods to get an array or struct of associated newspapers simply
by getting a language object.

http://docs.transfer-orm.com/wiki/Managing_Relationships_and_Compositions.cfm#OneToMany
http://docs.transfer-orm.com/wiki/Generated_Methods.cfm#OneToMany_Element

take a look at these two pieces of documentation, particularly the generated
methods page. There are all sorts of functions to assist you with retrieving
related data.

<http://docs.transfer-orm.com/wiki/Generated_Methods.cfm#OneToMany_Element>
Regards

Stephen

-- 
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

Try out the new Transfer ORM Custom Google Search:
http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en

Reply via email to