I am just wondering how different people would handle the problem below.
I have a Thread table/class that contains multiple Posts. Each Thread and Post have an author, which is associated with a User object. However, there is a Member object that extends the User, to allow for anonymous/unregistered posting.
Now, lets say I want to use the following logic:
Code:
//pseudo-code
if (the post's author is a member, get its member object)
do some stuff with the member object....
if (the post's author is not a member, get its user object)
do some stuff with the user object....
What is the best way to handle this? I am mapping in Hibernate with the <joined-subclass> tag and it seems to be working fine otherwise. I can save members and users without problems.
Thank you in advance for your input!