Hibernate/JPA Mapping to a Base Class
===

Considering the following entity. I intend to have the Child class reference any of the two derived food class ( Local Food or Foreign ). This is an contrived example, my real domain object are much complex, hence combining and using a FoodType column for example is not an option as both Food subclass are similar only in few traits.

    @MappedSuperclass
    public abstract class Food {

    }



    @Entity
    public class LocalFood extends Food {

	private long id;
	private String name;
    }


    @Entity
    public class ForeignFood extends Food {

	    private long id;
	    private String name;
    }



    @Entity
    public class Child {	
	private Food food; //Base Class needed here	
	@ManyToOne()
	public Food getFood() {
		return food;
	}
    }

    Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on                     com.sample.Child.food references an unknown entity: com.sample.Food


Neither does using inheritance and discriminator. 

    @Entity
    @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
    public abstract class Food {

	private long id; // set , get (Auto gen) 
    }

Is it possible to get this kind of mapping to work? 
