I found the answer in a totally unrelated post. I just have to annotate BaseEntity as @MappedSuperclass. The following code done what I needed.
@MappedSuperclass
class BaseEntity {
@Id
private int id;
//getters and setters.
}
@Entity
class Movie extends BaseEntity {
@Column
private String name;
@Column
private int year;
@Column
private int durationMins;
//getters and setters
}