if (oldEntity != null) {
EntityState state = instance.__caucho_getEntityState();
if (state.ordinal() <= EntityState.TRANSIENT.ordinal()
|| EntityState.P_DELETING.ordinal() <= state.ordinal()) {
throw new IllegalArgumentException(L.l("refresh() operation can only be applied to a managed entity instance. The entity state is '{0}' for object of class '{0}' with PK '{1}'", className, pk, state == EntityState.TRANSIENT ? "TRANSIENT" : "DELETING or DELETED"));
}
}
else
throw new IllegalArgumentException(L.l("refresh() operation can only be applied to a managed entity instance. There was no managed instance of class '{0}' with PK '{1}'", className, pk));