Hi
I have an user object. This user can belong in many departments. I have stored the user departments using an Array inside the user object.
When it comes to updating the user object back to the database. How will able to tell which new departments the user now belong to and same with which department the user no longer belong to?
The only method i can think of is removing all departments the user belong to and the then add the departments from the array list every time i update the user. However this do not sound very efficient to me. Is there a better way?
Thanks.
I have an user object. This user can belong in many departments. I have stored the user departments using an Array inside the user object.
When it comes to updating the user object back to the database. How will able to tell which new departments the user now belong to and same with which department the user no longer belong to?
The only method i can think of is removing all departments the user belong to and the then add the departments from the array list every time i update the user. However this do not sound very efficient to me. Is there a better way?
Thanks.