Hi everyone!
I'm new here and somewhat beginner to Hibernate...
I'm having some problems changing the value of one property in a associated class while inside its setter.
See the following code:
Code:
public class Comment {
private User oUser;
public virtual User User {
get { return oUser; }
set {
oUser = value;
// If this is a anonymous comment or the user isn't logged in, don't show its name/ID
if (Anonymous || (Application.UserID == 0)) {
oUser.Image = "anonymous.jpg";
Link = "<i>Anonymous</i>";
} else {
Link = "<a href=\"Profile.aspx?userID=" + oUser.ID + "\">" + oUser.Name + "</a>";
}
}
}
}
Some useful mapping:
Code:
<property name="Anonymous" column="anonymous" length="1" type="yes_no" />
<many-to-one name="User" column="userid" />
Here is the problem: everytime, no matter what happens, oUser.Image WILL be the string "anonymous.jpg".
Note that when I enter the setter while debugging,
value already has the Image property as anonymous.jpg.
What could be happening? I don't get what I've did wrong!
Thanks in advance, and sorry for my bad english!