Mapping m = om.getMapping(Path.get(e.getProperty().getName()));
Mapping m = om.getMapping(e.getProperty());
    private void onPropertyEvent(final PropertyEvent e) {        final Object obj = m_engine.getContainer(e.getObject());        final Object arg = e.getArgument();        final ObjectMap om = e.getObjectMap();        Mapping m = om.getMapping(Path.get(e.getProperty().getName()));        if (m == null) {            throw new IllegalStateException                ("no mapping for property: " + e.getProperty());        }        final Role role = (Role) e.getProperty();        if (e instanceof AddEvent && m.getAdds() != null) {            addOperations(obj, role, arg, m.getAdds());            return;        } else if (e instanceof RemoveEvent && m.getRemoves() != null) {            addOperations(obj, role, arg, m.getRemoves());            return;        } else if (e instanceof SetEvent) {            SetEvent se = (SetEvent) e;            Object prev = se.getPreviousValue();            if (prev != null && m.getRemoves() != null) {                addOperations(obj, role, prev, m.getRemoves());            }            if (arg != null && m.getAdds() != null) {                addOperations(obj, role, arg, m.getAdds());            }        }        m.dispatch(new Mapping.Switch() {            public void onQualias(Qualias q) {                // XXX need to really support read only            }            public void onStatic(Static m) {                // do nothing;            }            public void onNested(Nested n) {                // do nothing;            }            public void onValue(Value m) {                Column col = m.getColumn();                set(obj, col, arg);            }            public void onJoinTo(JoinTo m) {                set(obj, m.getKey(), arg);            }            public void onJoinFrom(JoinFrom m) {                Object toNull;                Object toSet;                if (e instanceof SetEvent) {                    SetEvent se = (SetEvent) e;                    toNull = se.getPreviousValue();                    toSet = arg;                } else if (e instanceof RemoveEvent) {                    toNull = arg;                    toSet = null;                } else if (e instanceof AddEvent) {                    toNull = null;                    toSet = arg;                } else {                    throw new IllegalArgumentException                        ("expecting ProperyEvent");                }                if (toNull != null) { set(toNull, m.getKey(), null); }                if (toSet != null) { set(toSet, m.getKey(), obj); }            }            public void onJoinThrough(JoinThrough m) {                if (role.isReversable()) {                    Role rev = role.getReverse();                    if (role.getName().compareTo(rev.getName()) < 0) {                        return;                    }                }                if (e instanceof SetEvent) {                    SetEvent se = ((SetEvent) e);                    Object prev = se.getPreviousValue();                    if (prev != null) {                        remove(m, obj, prev);                    }                    if (arg != null) {                        add(m, obj, arg);                    }                } else if (e instanceof AddEvent) {                    add(m, obj, arg);                } else if (e instanceof RemoveEvent) {                    remove(m, obj, arg);                } else {                    throw new IllegalArgumentException                        ("not a set, add, or remove");                }            }            private void add(JoinThrough m, Object obj, Object arg) {                if (m.getAdds() == null) {                    Table table = m.getFrom().getTable();                    Insert ins = new Insert(m_engine, table);                    set(ins, m.getFrom(), obj);                    set(ins, m.getTo(), arg);                    m_engine.addOperation(ins);                }            }            private void remove(JoinThrough m, Object obj, Object arg) {                if (m.getRemoves() == null) {                    Table table = m.getFrom().getTable();                    Delete del = new Delete(m_engine, table, null);                    filter(del, m.getFrom(), KEY_FROM, obj);                    filter(del, m.getTo(), KEY_TO, arg);                    m_engine.addOperation(del);                }            }        });    }