Announcement Announcement Module
No announcement yet.
How to change a query? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to change a query?

    I have a table that contains some foreign keys that refer to other tables.

    In the the list of the records I would like to show a field of the referenced values of the FK instead of the id value.
    The list generated by Roo shows for the FK field all the fields of the referenced table.

    How can I show just one field of the referenced table?



  • #2
    I try to rephrase my question:

    I have two table:
    1. one table stores documents
    2. the other stores the category for the documents

    In the first table (documents) there is a foreign key to the primary key of the second table (categories).

    In the Roo application, if I ask to show one document, the application shows all the information of the corresponding record of the second table.
    How can I tell the application to show just a particular field of the second table (the description of the category)?



    • #3
      I am assuming that you ran DBRE to generate entities. Can you post those some where.

      You may just need to edit your show or list.jspx files a bit to show the field of the entity in question.

      But first share your Roo specific code, otherwise with just this description it's not trivial to answer.