In Hibernate 2 I don't think there's a way to persist a proxy, given that Hibernate depends on the class name. I believe this changes in Hibernate 3 (but of course that doesn't help you much right now).
So you'll have to work around it. You could probably easily change your save method to unwrap the target and save it if the target is advised. Something like:
Code:
Object target = o;
if (o instanceof Advised) {
TargetSource ts = ((Advised) o).getTargetSource();
// Probably can't handle fancier target sources,
// but probably doesn't matter so you can just add
// a check and throw UnsupportedOperationException
target = ((SingletonTargetSource) ts).getTarget();
}
template.save(target);
I haven't tried this, but I think it would work.
A generic save method could do this easily enough for any advised (or non-advised) object.