I have Entity
DayProgram Code:
@Entity
public class DayProgram implements Serializable {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
private DayOfWeek dayOfWeek;
and
DayOfWeek Code:
@Entity
public class DayOfWeek implements Serializable{
@Id
@Column (name = "id")
@GeneratedValue (strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "dayOfWeek")
private String dayOfWeek;
I use a HQL to get all DayProgram where dayOfWeek.getDayOfWeek() = 'Mondey', but I do not understand how to do it
Code:
List<TrainingProgram> list = getSessionFactory().getCurrentSession().
createQuery("from TrainingProgram where dayOfWeek.dayOfWeek = 'Mondey' ").list();
It's not work, help me please