0

I'm working, for school purpose, to a java web application based on GWT and MapDB for data persistency. Since I'm not really familiar with MapDB I need some help. My application has to manage an online system for selling and buying through an auction mechanism. Registered users can sell products and make bids (or questions) for products selled by other users. Here's how I designed the classes:

Auction class:

public class Auction implements Serializable {
private int id; //unique id 
private String seller; //the (unique) username of the seller
private String objName; 
private String description; 
private String category; 
private Double startPrice; 
private Date expDate;
private Boolean state; //closed or open
private Bid currentBid; 
private String winner; //the user who wins 
private Infos info; //questions and answers

Infos class:

public class Infos implements Serializable {
private int id; //unique id
private String question;
private String answer;  

Bid Class:

public class Bid implements Serializable {
private String bidder; //username of the user who puts the bid
private Double bidPrice;  

I created the DB's files in this way:

DB db = DBMaker.newFileDB(new File(FILE_NAME)).closeOnJvmShutdown().make();
ConcurrentNavigableMap<Integer, Auction> auction= db.getTreeMap("auction");  

Now I'm thinking I'm doing something wrong. An auction can have more than one bid and more than one question (and answers). Plus, only the user who is selling can respond to a question regarding that auction. Maybe I have to delete the field Bid in Auction and insert a field Auction in Bid? Is there necessary that Auction knows what are the bid and the infos?

JamieITGirl
  • 161
  • 1
  • 11

0 Answers0