Ricardo Jost wrote:Ex of one review :
product/title: Fiskars Softouch Multi-Purpose Scissors 10"
review/profileName: R. GARCIA
review/summary: Best scissors ever
review/text: This Fiskars Scissors are the best i've bougth in time. It are excellent for delicated fabrics...
Every product have a productId, how would i "connect" the User with the reviews by the userID ?
So, i use a repetition(for), to every time i add, verify if the element already exists at the list right?
Stefan Evans wrote:Edit: Responding to Carey's comment: "Your Review class should have two key fields: userId, and productId."
Personally I don't think the Review class should have the ids. That's thinking like a database.
Thinking about the actual model, a review doesn't have a userId, it has a User who placed it.
Ricardo Jost wrote:I'll try with hashmap as you guys said, i understood now how they'll conect with each other, but will this assure that a specific product be "linked" only with his respective reviews?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton