Skip to content

Instantly share code, notes, and snippets.

@IDragonfire
Created September 19, 2014 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IDragonfire/a52ee26a6a0539732b27 to your computer and use it in GitHub Desktop.
Save IDragonfire/a52ee26a6a0539732b27 to your computer and use it in GitHub Desktop.
package de.raidcraft.auction.tables;
import com.avaje.ebean.validation.NotNull;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* @author Dragonfire
*/
@Getter
@Setter
@Entity
@Table(name = "auction_auctions")
public class TAuction {
@Id
private int id;
@NotNull
private UUID owner;
@NotNull
private int item;
@NotNull
@ManyToOne
private TPlattform plattform;
private double direct_buy;
private Date auction_end;
private double start_bid;
@OneToMany(cascade = CascadeType.REMOVE, mappedBy = "auction")
private List<TBid> all_bids = new ArrayList<TBid>();
public void Auction() {
}
public TAuction() {
}
public boolean isAuction() {
return start_bid >= 0;
}
public boolean isDirectBuy() {
return direct_buy >= 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment