Announcement

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

    getPrimaryKeys method from DataSource is returning "id" field twice

    Dear,

    Below are my ds.xml and Hibernate class used with my Hibernate DS type.

    SmartGWT version: 2.7.0

    Datasource
    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <DataSource ID="msePartnerContacts" serverType="hibernate"
    beanClassName="com.test.bo.PartnerContact"
    schemaBean="com.test.bo.PartnerContact">
    <serverObject lookupStyle="spring" bean="partnerContactDMI"/>
    
    <fields>
    <field name="id" type="text" hidden="true" escapeHTML="true" primaryKey="true" autoGenerated="true"/>
    </fields>
        <operationBindings>
          <operationBinding operationType="fetch" serverMethod="fetch"/>
            <operationBinding operationType="add" serverMethod="add"/>
            <operationBinding operationType="update" serverMethod="update" />
            <operationBinding operationType="remove" required="false" />
       </operationBindings>
    </DataSource>
    Hibernate
    Code:
    @Entity
    @Data
    public class PartnerContact
    {
    @Id
    @GeneratedValue(generator = "system-uuid") @GenericGenerator(name = "system-uuid", strategy = "uuid") @Column(name = "id", length = 32, updatable = false, nullable = false) private String id;
    }
    Looks like the following method returns list with "id" twice.
    * com.isomorphic.datasource.DataSource#getPrimaryKeys

    The below snippet code from BasicDataSource is the reason of that.

    Code:
    public List<String> getPrimaryKeys()
    {
    List<String> pks = new ArrayList();
    if (this.getSuper() != null)
    {
       pks = this.getSuper().getPrimaryKeys();
    }
    DataTools.addAll((List)pks, this.primaryKeys);
    return (List)pks; }
    Is this the expected behavior? From our view it should return a list with single "id" value.

    Best regards!
    Last edited by gustavo_b; 22nd Jan 2020, 07:22.

    #2
    Hi Gustavo
    Sorry for the delay responding on this report. It is being looked at - and we will post a proper follow up when we have more information for you

    Regards
    Isomorphic Software

    Comment


      #3
      This issue was already fixed in 12.1 and has now been applied to 12.0 available in nightly builds starting on 1/28/2020.

      Regards
      Isomorphic Software

      Comment

      Working...
      X