Order

[Back to 101 LINQ examples using Batches]

package tests.sql.northwind;
 
import java.sql.Date;
 
import batch.Fun;
import batch.Set;
import batch.sql.Column;
import batch.sql.Id;
import batch.sql.Inverse;
import batch.sql.Table;
 
@Table(name="Orders")
public abstract class Order {
 
    @Id
    public int OrderID;
 
    public Date OrderDate;
 
    public Date RequiredDate;
 
    public Date ShippedDate;
 
    @Column(name="CustomerID")
    public Customer Customer;
 
    @Inverse("Order")
    public Set<Order_Details> OrderDetails;
 
    public int Freight;
 
    static Fun<Order, Long> Year = new Fun<Order, Long>() {
        @SuppressWarnings("deprecation")
        public Long apply(Order p) {
            return (long)p.OrderDate.getYear();
        }
    };
    static Fun<Order, Long> Month = new Fun<Order, Long>() {
        @SuppressWarnings("deprecation")
        public Long apply(Order p) {
            return (long)p.OrderDate.getMonth();
        }
    };
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License