public Object getSessionKey(ObjectType type, PropertyMap props) { Collection keys = type.getKeyProperties(); Object key = null;  for (Iterator it = keys.iterator(); it.hasNext(); ) { Object value = props.get((Property) it.next()); if (key == null) { key = value; } else { key = new CompoundKey(key, value); } }  return new CompoundKey(type.getBasetype(), key);
public Object getSessionKey(Object obj) { return getSessionKey(getObjectType(obj), getProperties(obj));
    public Object getSessionKey(ObjectType type, PropertyMap props) {        Collection keys = type.getKeyProperties();        Object key = null;        for (Iterator it = keys.iterator(); it.hasNext(); ) {            Object value = props.get((Property) it.next());            if (key == null) {                key = value;            } else {                key = new CompoundKey(key, value);            }        }        return new CompoundKey(type.getBasetype(), key);    }