2015-07-12 53 views
2

org.hibernate.hql.ast.QuerySyntaxException:unexpected token:on near line 1,column 102 [FROM com.strutsProject.dto.EventClubTb爲C內加入com.strutsProject.dto.AchievementsTb爲A上A.EVENTNAME = C.EVENTNAME]org.hibernate.hql.ast.QuerySyntaxException:on near line 1,column 102 [FROM com.strutsProject.dto.EventClubTb

字符串HQL =「FROM com.strutsProject.dto.EventClubTb作爲C內部加入com.strutsProject.dto.AchievementsTb作爲A上A.EVENTNAME = C.EVENTNAME「; Query query = session.createQuery(hql);

@Entity @Table(名稱= 「clubevent」)

private static final long serialVersionUID=-8767337896773261247L; 
private Long id; 
private String eventname; 
private AchievementsTb actb; 
@OneToOne 
@JoinColumn(name = "actbeventname")`enter code here 
public AchievementsTb getActb() {`enter code here` 
    return actb; 
} 
public void setActb(AchievementsTb actb) { 
    this.actb = actb; 
} 

public String getEventname() { 
    return eventname; 
} 
public void setEventname(String eventname) { 
    this.eventname = eventname; 
} 

@Entity @Table(名稱= 「成績」) 公共類AchievementsTb延伸ViewAllGridList {

private static final long serialVersionUID=-8767337896773261247L; 
private Long id; 
private String eventname; 
public String getEventname() { 
    return eventname; 
} 
public void setEventname(String eventname) { 
    this.eventname = eventname; 
} 
public String getDescription() { 
    return description; 
} 
public void setDescription(String description) { 
    this.description = description; 
} 

Blockquote

回答

0

如果EventClubTbAchievementsTb相關:

FROM com.strutsProject.dto.EventClubTb as C join C.achievementsTb as A 

否則,你可以使用傳統的THETA式連接:

FROM com.strutsProject.dto.EventClubTb as C, com.strutsProject.dto.AchievementsTb as A 
where A.EVENTNAME=C.EVENTNAME 
相關問題