I am fetching all the slots between two dates by comparing two datetime columns 'start' and 'end' mapped with java.util.Date

**Error**

```
unexpected token: end near line 1, column 74 [From 
com.booking.tokbox.domain.Slot where 
ownerid = ? and start >= ? and end <= ?]

```

**DAO Method**

```
public List<Slot> fetchSlots(Session session,int ownerid,String start,String end) throws ParseException{
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    Date startDate = dateFormat.parse(start);
    Date endDate = dateFormat.parse(end);
    List<Slot> slots = null;
    Query query = session.createQuery("From Slot where ownerid = ? and start >= ? and end <= ?").setParameter(0,ownerid)
            .setParameter(1, startDate).setParameter(2,endDate);
    slots = query.list();
    if(slots.size() > 0)
        return slots;
    return null;
}

```

**Slot - Domain class**

```
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

@Entity
@Table(name="SLOT")
public class Slot {

    public Slot(){

    }

    @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="slotid")
    private Integer id;

    @OneToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="ownerid",insertable = false, updatable = false)
    private User user;

    @Column(name="start")
    private Date start;

    @Column(name="end")
    private Date end;

    @Column(name="status")
    private String status;

    private Integer ownerid;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "created", nullable = false, updatable=false)
    @Version
    private Date created;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public User getUser() {
        return this.user;
    }

    public void setUser(User owner) {
        this.user = owner;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getOwnerid() {
        return ownerid;
    }

    public void setOwnerid(Integer ownerid) {
        this.ownerid = ownerid;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getStart() {
        return start;
    }

}

```