I have a service method that calls a DAO which then returns an object from the database. This method is called from numerous parts of the system. However, one particular method
Hibernate returns proxies if not all members are resolved, i.e. the object is not complete. This is often a desired feature to improve performance and is (I think) the default setting in hibernate.
If you do not want proxies you can suppress lazy loading in the hbm.xml file, i.e. use eager loading. Please check the hibernate docs for the exact syntax.
To use the proxy object just never access a member directly but only via getter, even within member functions. Hibernate magic fills in the member when you get it. This way you never have to expose the object. Also don't use instanceof on potential proxy objects. But this is a code smell anyway.