my dog learned polymorphism
The moose likes Object Relational Mapping and the fly likes How would you map this? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How would you map this?" Watch "How would you map this?" New topic

How would you map this?

Zoran Roncevic

Joined: Nov 17, 2011
Posts: 13

I'm going to develop a web application that keeps track on basketball statistics. Currently I'm at the beginning of it all and I have a question for you guys, how would you map this classes.
I have a class Clubs with a mapping OneToMany to a class Players.
Then I'm thinking of making a class Game that will have a game id and two clubs that are playing a game.
I also need a class Statistics that will have records of free throws attempts/scored, two points attempts/scored......

To clear things up let me explain how the application should look like: When clubs and it's players are inputed, you should make a game that would have it's id.
Then when selecting a game you should be able to select players from the both teams that have played the game, and continue to the page where you should actually enter the statistics.
On that page you should see the 2 teams and their players with input field for statistics - free throw attempts/scored... I hope you get the idea....
Can somebody help?
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3902

Rather than thinking about the mapping first I'd suggest you get the domain model right, then worry about mapping. When you have the domain model correct you can see the available options for mapping and then make appropriate changes if necessary.

[How to ask questions] [Twitter]
I agree. Here's the link:
subject: How would you map this?
It's not a secret anymore!