Announcement

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

    Primary Key in XSD DataSource

    Hello,
    is there a way to define the primary key of a field in the XSD file?

    Like in the following XSD snippet:
    Code:
    <xsd:key name="MemberKey">
        <xsd:selector xpath="Member" />
        <xsd:field xpath="@Nick" />
    </xsd:key>
    But without calling
    Code:
    dataSource.getField("Nick").setPrimaryKey(true);
    the field will not be a primary key.


    Regards,
    Hanno

    #2
    Hello Hanno,

    You can use schema chaining (see DataSource.setInheritsFrom) to mark a field as a primaryKey and add any other presentation-specific metadata (such as user visible titles) required in your UI.

    The idea of auto-deriving the primary key based on XML Schema <key> declaration is interesting - we'll look at adding that.

    Comment


      #3
      Anything new in this subject? Is it possible now to define primary key directly in XSD schema?

      Comment

      Working...
      X