Retrieving values of foreign key relations
Author: PeterMu
Publication Date: 3/26/2012 21:19
Hello everyone,
I'm wondering how to get the value(s) of foreign key relations when querying a table row. Using the #row object, the results I get are in entity format:
de.espirit.or.impl.EntityImpl@7781c783{f_companies,PERSISTENT,released,fs_id=791,fs_valid_from=1321381679534,fs_valid_to=9223372036854775807,fs_release_to=9223372036854775807}
Using the .length() function as in $CMS_VALUE(#row.f_companiesList.length)$, I can also recover the number of relations found. What I'm missing is how to get textual value of such relations.
Thanks fro any help you can provide!
Peter
Tags: database, query, row
-
Author: broszeit - 3/27/2012 7:14
Hello Peter,
you can access any value of the company table using this syntax:
#row.f_companiesList.COLUMNNAME
If you have a 1:n oder m:n relationship you can access every single value with the following code
For example the company list: (with a column "Name" in the table "Companies")
$CMS_FOR(company, #row.f_companiesList)$
$CMS_VALUE(company.Name)$
$CMS_END_FOR$
Rouven
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
1 commentaire