private void addValidatorToEnsureIdentityType() {
MetaModelValidatorVisiting.Visitor ensureIdentityType = new MetaModelValidatorVisiting.Visitor(){
@Override
public boolean visit(ObjectSpecification objSpec, ValidationFailures validationFailures) {
final JdoPersistenceCapableFacet jpcf = objSpec.getFacet(JdoPersistenceCapableFacet.class);
if(jpcf == null) {
return true;
}
final IdentityType identityType = jpcf.getIdentityType();
if(identityType == IdentityType.APPLICATION) {
// ok
} else if(identityType == IdentityType.NONDURABLE) {
// ok; for use with view models (http://www.datanucleus.org/products/accessplatform_3_2/datastores/rdbms_views.html)