} else {
// Check that is for this tenant
String name = op.getExecutionContext().getStoreManager().getNamingFactory().getColumnName(op.getClassMetaData(),
ColumnType.MULTITENANCY_COLUMN);
if (!entity.hasProperty(name)) {
throw new NucleusObjectNotFoundException(
"Could not retrieve entity of kind " + key.getKind() + " with key " + key);
} else {
String tenantVal = (String)entity.getProperty(name);
if (!op.getExecutionContext().getStoreManager().getStringProperty(PropertyNames.PROPERTY_TENANT_ID).equals(tenantVal)) {
throw new NucleusObjectNotFoundException(
"Could not retrieve entity of kind " + key.getKind() + " with key " + key + " : was for different tenant " + tenantVal);
}
}
}
}