committing hibernate part with model Bar and Foo