Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. ``` def class Order:
  2. @DatabaseTable(tableName = "Orders")
  3. public class Order{
  4.  
  5. public Order(){}
  6.  
  7. @DatabaseField(generatedId = true)
  8. private int id;
  9.  
  10. @DatabaseField(columnName = "Date", canBeNull = false)
  11. private Date date;
  12.  
  13. public int getId() { return id; }
  14. public void setId(int id) { this.id = id; }
  15.  
  16. public Date getDate() { return date; }
  17. public void setDate(Date date) { this.date = date; }
  18. }
  19.  
  20. @DatabaseTable(tableName = "Products")
  21. public class Product{
  22.  
  23. public Product(){}
  24.  
  25. @DatabaseField(generatedId = true)
  26. private int id;
  27.  
  28. @DatabaseField(columnName = "Name", canBeNull = false)
  29. private String name;
  30.  
  31. public int getId() { return id; }
  32. public void setId(int id) { this.id = id; }
  33.  
  34. public String getName() { return name; }
  35. public void setName(String name) { this.name = name; }
  36. }
  37.  
  38. @DatabaseTable(tableName = "Order_Products")
  39. public class Order_Product{
  40.  
  41. public Order_Product(){}
  42.  
  43. @DatabaseField(id = true, uniqueCombo=true)
  44. private int order_id;
  45.  
  46. @DatabaseField(id = true, uniqueCombo=true)
  47. private int product_id;
  48.  
  49. @DatabaseField(columnName = "Quantity", canBeNull = false)
  50. private int quantity;
  51.  
  52. public int getOrder_id() { return order_id; }
  53. public void setOrder_id(int order_id) { this.order_id = order_id; }
  54.  
  55. public int getProduct_id() { return product_id; }
  56. public void setProduct_id(int product_id) { this.product_id = product_id; }
  57.  
  58. public int getQuantity() { return quantity; }
  59. public void setQuantity(int quantity) { this.quantity = quantity; }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement