I've two organizations: Dealers and Makes. Sellers have multiple makes.I can place the records like a one-to-many relationship between both of these organizations.

However, I'm not in a position to retrieve the records according to dealer ID. I attempted a number of ways and it is still tossing this exception: Property not found make(it is table) of : class name(full classname)

If anybody could provide me with a few hints, it might be greatly appreciated.

Dealer:

 import java.util.HashSet;
    import java.util.Set;    
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.FetchType;
    import javax.persistence.GeneratedValue;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import javax.persistence.OneToMany;
    import javax.persistence.JoinTable;
    import javax.persistence.CascadeType;
    import javax.persistence.JoinColumn;
    @Entity
    @Table(name = "dealer")
    public class Dealer implements java.io.Serializable{
        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        public Dealer(){

        }
        public Dealer(String DealerName,String dealerPhno,Set makes){
            this.dealerName=DealerName;
            this.dealerphno=dealerPhno;
            this.dealerMakes=makes;

        }
        public void setDealerMakes(Set<Make> dealerMakes) {
            this.dealerMakes = dealerMakes;
        }
        @Id
        @GeneratedValue
        @Column(name = "dealer_id")
        private long dealerId;
        public long getDealerId() {
            return dealerId;
        }
        public void setDealerId(long dealerId) {
            this.dealerId = dealerId;
        }
        public String getDealerName() {
            return dealerName;
        }
        public void setDealerName(String dealerName) {
            this.dealerName = dealerName;
        }
        public String getDealerphno() {
            return dealerphno;
        }
        public void setDealerphno(String dealerphno) {
            this.dealerphno = dealerphno;
        }
        @Column(name = "dealer_name" ,unique=true, nullable = false, length=20)
        private String dealerName;
        @Column(name = "dealer_phno" , nullable = false, length=20)
        private String dealerphno;
        @OneToMany(cascade = CascadeType.ALL)
        //@OneToMany(fetch=FetchType.EAGER)
        @JoinColumn(name="dealer_id", nullable=false)
        //@JoinTable(name = "dealer_make", joinColumns = { @JoinColumn(name = "dealer_id") }, inverseJoinColumns = { @JoinColumn(name = "make_id") })
        private Set<Make> dealerMakes = new HashSet<Make>(0);

        public Set<Make> getDealerMakes() {
            return dealerMakes;
        }

    }

Make

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "make")
public class Make implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 2L;
    public Make(){

    }
    public Make(String makeName,String modelName,String price){

        this.makeName=makeName;
        this.modelName=modelName;
        this.price=price;
    }
    public long getMakeId() {
        return makeId;
    }
    public void setMakeId(long makeId) {
        this.makeId = makeId;
    }
    public String getMakeName() {
        return makeName;
    }
    public void setMakeName(String makeName) {
        this.makeName = makeName;
    }
    public String getModelName() {
        return modelName;
    }
    public void setModelName(String modelName) {
        this.modelName = modelName;
    }
    public String getPrice() {
        return price;
    }
    public void setPrice(String price) {
        this.price = price;
    }
    @Id
    @GeneratedValue
    @Column(name = "make_id")
    private long makeId;
    @Column(name = "make_name" , nullable = false, length=8)
    private String makeName;
    @Column(name = "model_name" , nullable = false, length=8)
    private String modelName;
    @Column(name = "price" , nullable = false, length=8)
    private String price;

}

Query I attempted:

 Criteria dealer=sessionFactory.getCurrentSession().createCriteria(Dealer.class);
 Criteria make=dealer.createCriteria(make);
 make.add(Restrictions.gt("dealerId",new Long(dealerId)));
 List<Dealer> results=dealer.list(); //throwing exception

Ouput i'm expecting:

Dealer_Id dealername phonenumber

1 halal 074563485

Make has below records:

make_id makename makeprice dealer_id

1 ford 3000$ 1

2 hyundai 2000One Dollar

I would like results like dealer particulars with make particulars.