Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ``` def class Order:
- @DatabaseTable(tableName = "Orders")
- public class Order{
- public Order(){}
- @DatabaseField(generatedId = true)
- private int id;
- @DatabaseField(columnName = "Date", canBeNull = false)
- private Date date;
- public int getId() { return id; }
- public void setId(int id) { this.id = id; }
- public Date getDate() { return date; }
- public void setDate(Date date) { this.date = date; }
- }
- @DatabaseTable(tableName = "Products")
- public class Product{
- public Product(){}
- @DatabaseField(generatedId = true)
- private int id;
- @DatabaseField(columnName = "Name", canBeNull = false)
- private String name;
- public int getId() { return id; }
- public void setId(int id) { this.id = id; }
- public String getName() { return name; }
- public void setName(String name) { this.name = name; }
- }
- @DatabaseTable(tableName = "Order_Products")
- public class Order_Product{
- public Order_Product(){}
- @DatabaseField(id = true, uniqueCombo=true)
- private int order_id;
- @DatabaseField(id = true, uniqueCombo=true)
- private int product_id;
- @DatabaseField(columnName = "Quantity", canBeNull = false)
- private int quantity;
- public int getOrder_id() { return order_id; }
- public void setOrder_id(int order_id) { this.order_id = order_id; }
- public int getProduct_id() { return product_id; }
- public void setProduct_id(int product_id) { this.product_id = product_id; }
- public int getQuantity() { return quantity; }
- public void setQuantity(int quantity) { this.quantity = quantity; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement