This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I have a TAG table and an ARTICLE table. The relationship in the ejb is set to many to many creating a join table automatically.
1) I get a string of tags and delimit them appropriately.
2) I then store each of the 'tokens' in an array.
3) Once getting these tokens, check each token and ensure it doesn't exist in the TAG table
3.1) If it does exist get that TAG object and store in the TAG_ARTICLE table
3.2) if it doesnt store the new tag in the TAG table aswell as the TAG_ARTICLE table.