Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Enhancement: table-alias attribute in .ds.xml files (DataSource or DataSourceField)

    Hi Isomorphic,

    I'd like to suggest a new attribute for http://www.smartclient.com/smartgwte...ataSource.html. I think an attribute "alias" could be useful here.
    It would act the following: If given, the generated <tableClause> is "FROM tablename alias" (or "JOIN tablename alias ON ...") and all column accesses (in fieldlist and criterialist) in generated would be like "alias.columname" instead of "table.columname".

    Reason: If I right now have a table that has 2 FK to the same table, I can't include fields from both joined tables, as it is currently not possible to tell them apart.
    This way I could create .ds.xml file stubs for the linked table with just the alias and a inheritsFrom.
    Currently I have to do this and also create a view with "select * from base_table" or to write the <tableClause> with join in XML on my own and use the field-level attribute "tableName".

    A even better solution would involve an additional attribute on the field level, where I can give a renameTo in addition to foreignKey.

    What do you think of the suggestion?

    Best regards,
    Blama

    #2
    See DataSourceField.includeVia.

    Comment


      #3
      Hi Isomorphic,

      unbelievable, thank you and once again a big thumbs up for your great framework.

      As note: IncludeVia is javadoc'd as java method, but not in the .ds.xml docs.

      Will try it now as .ds.xml attribute.

      Best regards,
      Blama

      Comment


        #4
        Yes, these are indeed .ds.xml properties - thanks for pointing out the doc issue, that's been fixed.

        Comment


          #5
          Thanks,

          while you are at it: nativeFK (generated by datasource generator) is also not javadoc'd in .ds.xml docs.

          Best regards,
          Blama

          Comment


            #6
            That's intended - this is not a property that should be relied on.

            Comment


              #7
              Hi Isomorphic,

              thanks for the clarification. Could you just write that into the .ds.xml docs? Because the field is generated and one wonders how to deal with it and if or if not it has any meaning.
              A doc like "generated by Batch DS Generator as convenience, transform to foreignKey or remove" would be enough.

              Best regards,
              Blama

              Comment

              Working...
              X