如何使用docid列值选择此表中的行,并检索约会表中的值以及患者表中的某些值。查询应该在条件API中。 实体类如下,有两个连接。
@Entity
@Table(name="APPOINTMENT")
public class Appintment implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(unique=true, nullable=false, length=20)
private String appid;
@Temporal(TemporalType.DATE)
@Column(name="APP_DATE", nullable=false)
private Date appDate;
//bi-directional many-to-one association to Doctors
@ManyToOne
@JoinColumn(name="DOCID", nullable=false)
private Doctor doctor;
//bi-directional many-to-one association to Patients
@ManyToOne
@JoinColumn(name="USERID", nullable=false)
private Patient patient;
}