Originally posted by frantaylor
View Post
Tables:
Users (userid, username)
FavoriteColors (userid, colorname)
Add color:
INSERT INTO FavoriteColors VALUES (123, 'green')
Remove color:
DELETE FROM FavoriteColors WHERE userid=123 AND colorname='green'
Get all colors:
SELECT colorname FROM FavoriteColors WHERE userid=123
Objects:
User (userid, ..., favoritecolors (a list))
the O/R mapping is straight forward: A list of something inside an object -> a table of something with the primary key of the object as a foreign key.
Doesn't look to difficult for me.
Originally posted by frantaylor
View Post
Comment