-
Jan 18th, 2011, 05:49 PM
#1
General Question Spring 3.0, Passed Objects
I have a general question about how spring works.
I recently upgraded a project written for Spring 2.x, Java 1.5, and Tomcat 5.5 to work with Spring 3.x, Java 6 and the Virgo Web Server. I found that the new platform treats a piece of the code differently.
I have some (admittedly bad) code
public class UserJdbc implements UserDao {
public int save(User user) {
.. get some stuff from user...
.. save stuff to db...
user.setUserID(lSaver.run());
return user.getUserID();
}
}
The trouble is that the user object will not allow me to set it's properties in certain instances.
I know I shouldn't be bothering to set it's properties, and I'm in the process of changing that code... but I'm wondering why this happens.
If I call an instance of UserDao directly from a Service (UserService), I can set the properties. However, if UserService calls another service, PersonService, which then calls on UserDao, the properties of the passed in object cannot be changed. Why is this happening?
-
Jan 21st, 2011, 03:51 PM
#2
100%, disregard this message. Some code refactoring went awry resulting in misnaming this was the obvious implication of aforementioned misnaming.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules