Hi
I do not understand your question.... What is the class1 parameter you pass into the addObject method ?
Can you show how you would call this method ?
As long as the entity you want to save is mapped (i.e. there is a hbm.xml file for it or you have annotated it) you just pass it to the save/update method.
Unrelated to your question but....
Why do you return a
String "success" ? This looks like a good candidate for a boolean. Or, even better make it void. Because as long as no Exception is thrown it will be a success.
Pascal