public Object save(Object entity) {
Session session = null;
try {
session = PersistenceManagerUtils.getSession(this.getPersistenceManager(), true);
PrevaylerCallback callback = new SaveCallback(entity);
Object saved = session.execute(callback);
if (entity != saved) {
session.execute(new MergeCallback(saved, entity));
}
return saved;