-
-
Save IDragonfire/a52ee26a6a0539732b27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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