// Really the table should have some way of doing this. TODO : Refactor this
StateManager sm = StateManagerFactory.newStateManagerForHollow(om, objectClass, id);
JavaTypeMapping idMapping = primaryTable.getIDMapping();
ScalarExpression fieldExpr = idMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
ScalarExpression fieldValue = idMapping.newLiteral(stmt, sm.getObject());
stmt.andCondition(fieldExpr.eq(fieldValue), true);
// Perform the query
try
{
Transaction tx = om.getTransaction();