Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1447

select visitor needed for many cases

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • (Java) V4 4.7.1
    • None
    • odata4-server
    • None

    Description

      The oData entity might return more columns that the database table o read from actually contains. Therefor it would be good to have a visitor pattern for the select list as well, similar to the $filter implementation.

       

      Example: My table has the columns FIRSTNAME, LASTNAME. The oData service should have another extra column FULLNAME which is the concat of the two. 

      Using the suggested code line

      String selectList = odata.createUriHelper().buildContextURLSelectList(edmEntityType, null, selectOption);

      returns all three columns and the SQL will fail. The SQL to be generated needs to be 

      select FIRSTNAME, LASTNAME, FIRSTNAME || ' ' || LASTNAME from ...

       

      I would think this is a quite common requirement, e.g. the ID column of a table with multiple PK columns would be the concat of all.

       

      Actually, thinking about it, it needs to be more than that. The same artificial column can be used in a filter as well.

       

      Any ideas?

      Attachments

        Activity

          People

            Unassigned Unassigned
            wdaehn Werner Daehn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: