Dear,
Below are my ds.xml and Hibernate class used with my Hibernate DS type.
SmartGWT version: 2.7.0
Datasource
Hibernate
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.
Is this the expected behavior? From our view it should return a list with single "id" value.
Best regards!
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>
Code:
@Entity @Data public class PartnerContact {[INDENT]@Id[/INDENT][INDENT]@GeneratedValue(generator = "system-uuid") @GenericGenerator(name = "system-uuid", strategy = "uuid") @Column(name = "id", length = 32, updatable = false, nullable = false) private String id;[/INDENT] }
* 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; }
Best regards!
Comment