if (method.getName().equals("hashCode") && id.intValue() != 0) {
if (method.getName().equals("hashCode")) {
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy)        throws Throwable {        if (method.getName().equals("finalize")) {            return null;        }        if (method.getName().equals("setObjectStore")) {            this.os = (ObjectStore) args[0];            return null;        }        if (method.getName().equals("equals")) {            Object o = args[0];            if (o == null) {                return null;            }            java.lang.reflect.Field f = o.getClass().getDeclaredField("id");            f.setAccessible(true);            int otherId = f.getInt(o);            if (otherId != 0) {                return new Boolean(id.intValue() == otherId);            }        }        if (method.getName().equals("hashCode") && id.intValue() != 0) {            return id;        }        if (realSubject == null) {            if (os == null) {                throw new Exception(method.getName() + ": ObjectStore is null");            }            try {                realSubject = ((ResultsRow) os.execute(query, 0, 1).get(0)).get(0);            } catch (Exception e) {                throw new Exception(method.getName() + ": Materialization problem: " + e);            }            if (realSubject == null) {                throw new Exception(method.getName() + "realSubject is still null");            }        }        return method.invoke(realSubject, args);    }