[Back to 101 LINQ examples using Batches]

package tests.sql.northwind;
import batch.Fun;
import batch.Set;
import batch.sql.Column;
import batch.sql.Id;
import batch.sql.Inverse;
import batch.sql.Table;
public abstract class Product {
    public int ProductID;
    public String ProductName;
    public String QuantityPerUnit;
    public double UnitPrice;
    public long UnitsInStock;
    public int UnitsOnOrder;
    public int ReorderLevel;
    public boolean Discontinued;
    public Category Category;
    public Supplier Supplier;
    public Set<Order_Details> OrderDetails;
    public abstract void delete();
    static Fun<Product, Boolean> isOutOfStock = new Fun<Product, Boolean>() {
        public Boolean apply(Product p) {
            return p.UnitsInStock == 0;
    static Fun<Product, String> byCategoryName = new Fun<Product, String>() {
        public String apply(Product p) {
            return p.Category.CategoryName;
    static Fun<Product, Category> byCategory = new Fun<Product, Category>() {
        public Category apply(Product p) {
            return p.Category;
    static Fun<Product, String> byName = new Fun<Product, String>() {
        public String apply(Product p) {
            return p.ProductName;
    static Fun<Product, Long> byUnitsInStock = new Fun<Product, Long>() {
        public Long apply(Product p) {
            return p.UnitsInStock;
    static Fun<Product, Double> byUnitPrice = new Fun<Product, Double>() {
        public Double apply(Product p) {
            return p.UnitPrice;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License