After upgrading from SmartGWT 12.1 to 13.0, we see the following WARN log and our fetches don't filter properly:
WARN [com.isomorphic.jpa.JPADataSource] (https-jsse-nio-8443-exec-8) Field name: 'pojoId1' specified in criteria is non-persistent. Skipping.
WARN [com.isomorphic.jpa.JPADataSource] (https-jsse-nio-8443-exec-8) Field name: 'pojoId2' specified in criteria is non-persistent. Skipping.
The field it is referencing are the primary key fields in our POJO:
And the ds.xml looks like:
WARN [com.isomorphic.jpa.JPADataSource] (https-jsse-nio-8443-exec-8) Field name: 'pojoId1' specified in criteria is non-persistent. Skipping.
WARN [com.isomorphic.jpa.JPADataSource] (https-jsse-nio-8443-exec-8) Field name: 'pojoId2' specified in criteria is non-persistent. Skipping.
The field it is referencing are the primary key fields in our POJO:
Code:
@Entity
@Table(name="BasePojo")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name = "pojoId1", discriminatorType = DiscriminatorType.INTEGER, length = 2)
public abstract class BasePojo {
@EmbeddedId
private PojoKey key;
@Column(name = "pojoId1", updatable = false, insertable = false)
private int pojoId1;
@Column(name = "pojoId2", updatable = false, insertable = false)
private int pojoId2;
}
@Entity
@Table(name = "PojoA")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "val", discriminatorType = DiscriminatorType.STRING)
public abstract class PojoA extends BasePojo {
@Column(name = "val", nullable = true, length = 32)
private String val;
...
}
@Entity
@Table(name="MyPojo")
@DiscriminatorValue(value="1")
@XmlDiscriminatorValue("1")
public class MyPojo extends PojoA {
...
}
@Embeddable
public class PojoKey implements Serializable {
@Column(name = "pojoId1")
private int pojoId1;
@Column(name = "pojoId2")
private int pojoId2;
}
@Entity
@Embeddable
@Table(name = "PojoB")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "field", discriminatorType = DiscriminatorType.STRING)
@XmlAccessorType(XmlAccessType.NONE)
public abstract class PojoB extends PojoA{
...
}
@Entity
@Table(name="YourPojo")
@DiscriminatorValue(value="2")
@XmlAccessorType(XmlAccessType.NONE)
@XmlDiscriminatorValue("2")
public class YourPojo extends PojoA {
...
@Embedded
private PojoB pojoB;
}
Code:
<DataSource
ID="myPojoDMI"
serverConstructor="com.isomorphic.jpa.JPADataSource"
beanClassName="app.MyPojo"
dropExtraFields="true">
<fields>
<field name="pojoId1" type="integer" required="true" primaryKey="true"/>
<field name="pojoId2" type="integer" required="true" primaryKey="true"/>
...
</fields>
</DataSource>
<DataSource
ID="yourPojoDMI"
serverConstructor="com.isomorphic.jpa.JPADataSource"
beanClassName="app.YourPojo"
dropExtraFields="true">
<fields>
<field name="pojoId1" type="integer" required="true" primaryKey="true"/>
<field name="pojoId2" type="integer" required="true" primaryKey="true"/>
...
</fields>
</DataSource>
Comment