if (pkType.equals(String.class))
return new StringId(cls, (String) oid);
if (pkType.equals(BigDecimal.class))
return new BigDecimalId(cls, (BigDecimal) oid);
if (pkType.equals(BigInteger.class))
return new BigIntegerId(cls, (BigInteger) oid);
} catch (ClassCastException cce) {
// swallow, the proper exception will be thrown below
expected = pkType;
}
}