two kind of object in hibernate