Hi,

I am reading book EnjoyWebDevelopmentWithTapestry - chapter about using Hibernate in and I am curious why is after getting object from database cloned?

after

UserAccount ua =  session.load(UserAccount.class, id);

is object cloned and used cloned version.

return ua.makeCopy();

    public UserAccount makeCopy(){
       UserAccount u = new UserAccount();
       u.setAddress(this.getAddress());
       u.setEmail(this.getEmail());
       u.setId(this.getId());
       u.setName(this.getName());
       u.setSurname(this.getSurname());
       u.setUsername(this.getUsername());
       return u;
}

Why do I need this? Why not to send original of the loaded object?

Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to