I have a fairly simple AdvancedCriteria that is checking the values of an Embeddable.
The server reports that "/status/status1 specified in criteria is not defined in data source. Skipping."
However, DataSource.evaluateCriterion(record, criteria) will filter the results returned by the server as expected.
Am I missing something here?
Here is a similar implementation to our model
Test.java
Status.java
StatusType.java
Status.ds.xml
Test.ds.xml
Criteria
I forgot this detail: SmartClient Version: v9.1p_2015-09-26/PowerEdition Deployment (built 2015-09-26)
The server reports that "/status/status1 specified in criteria is not defined in data source. Skipping."
However, DataSource.evaluateCriterion(record, criteria) will filter the results returned by the server as expected.
Am I missing something here?
Here is a similar implementation to our model
Test.java
Code:
@Entity public class Test { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Embedded private Status status; public long getId() {return id;} public void setId(long id) {this.id = id;} public Status getStatus() {return status;} public void setStatus(Status status) {this.status = status;} }
Code:
@Embeddable public class Status { private StatusType status1; private StatusType status2; public StatusType getStatus1() { return status1;} public void setStatus1(StatusType status1) {this.status1 = status1;} public StatusType getStatus2() {return status2;} public void setStatus2(StatusType status2) {this.status2 = status2;} }
Code:
public enum StatusType { ACTIVE, INACTIVE }
Code:
<DataSource beanClassName="Status" ID="Status_DS"> <fields> <field name="status1" type="enum"> <valueMap ACTIVE="Active" INACTIVE="Inactive"/> </field> <field name="status2" type="enum"> <valueMap ACTIVE="Active" INACTIVE="Inactive"/> </field> </fields> </DataSource>
Code:
<DataSource beanClassName="Test" ID="TEST_DS" serverConstructor="com.isomorphic.jpa.JPA2DataSource"> <fields> <name="id" type="sequence" primaryKey="true"/> <name="status" type="Status_DS"/> </fields> </DataSource>
Code:
AdvancedCriteria criteria = new AdvancedCriteria(OperatorId.AND, new Criterion[] { new Criterion("/status", OperatorId.NOT_NULL), new Criterion("/status/status1", OperatorId.NOT_NULL), new Criterion("/status/status1", OperatorId.EQUALS, StatusType.ACTIVE.name()) });
Comment