Hello,
Please fix my hql, i try to use hql left join
etc table
AskCommitment (master table)
idAsk Question
1 Ask1
2 Ask2
3 Ask3
Rwycommitment
idAsk Answer
1 T
2 Y
i have use hql like this
Code:
from Rwycommitment as r left join r.askCommitment as ask
where ask.idAsk = r.askCommitment
but result like
idAsk question answer
1 Ask1 T
2 Ask2 Y
i want result like this
idAsk question answer
1 Ask1 T
2 Ask2 Y
3 Ask3 null
this my code
Code:
@Entity
@Table(name="t_askcommitment")
public class AskCommitment implements java.io.Serializable{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="ID_ASK")
private int idAsk;
@Column(name="QUESTION", nullable=true, unique=false, length=400)
private String question;
Code:
@Entity
@Table(name="t_rwycommitment")
public class Rwycommitment implements java.io.Serializable{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="ID_COM")
private long idCom;
@Column(name="ANSWER", nullable=true, unique=false, length=3)
private String answer;
@ManyToOne
@JoinColumn(name="ID_ASK")
private AskCommitment askCommitment;
thanks[/code]