// We have to create a StateManager here just to map fields from the AppId key object
// to the table fields. Really the table should have some way of doing this. TODO : Refactor this
Class pc_class = om.getClassLoaderResolver().classForName(schemaDataOption.getName());
StateManager sm = StateManagerFactory.newStateManagerForHollow(om,pc_class,id);
ScalarExpression fieldExpr = idMapping.newScalarExpression(qs, qs.getMainTableExpression());
ScalarExpression fieldValue = idMapping.newLiteral(qs, sm.getObject());
qs.andCondition(fieldExpr.eq(fieldValue), true);
// Discriminator for this class
JavaTypeMapping discrimMapping = schemaDataOption.getDatastoreContainerObject().getDiscriminatorMapping(false);
DiscriminatorMetaData discrimMetaData = cmd.getInheritanceMetaData().getDiscriminatorMetaData();