org.hibernate.hql.ast.QuerySyntaxException:意外令牌:在第1行附近,第102列[FROM com.strutsProject.dto.EventClubTb as C inner join com.strutsProject.dto.AchievementsTb as A. on A.EVENTNAME = C.EVENTNAME]
String hql =“FROM com.strutsProject.dto.EventClubTb as C inner join com.strutsProject.dto.AchievementsTb as A. on A.EVENTNAME = C.EVENTNAME”; 查询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(NAME = “成就”) public class 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;
}
块引用
答案 0 :(得分:0)
如果[
{
"news_id":"8",
"title":"ddd",
"description":"ddd",
"photo":"News_images\/20020_1116863714996046_8844424307040103167_n.jpg",
"posted_on":"2015-07-12 12:54:48",
"news_type":"image_slider",
"dept_id":"1"
}
]
与<li><a href="' + my_href + '"><img src="' + img_source + '" alt="" title="' + my_title + '" id="' + slider_index + '" /></a></li>
相关联:
EventClubTb
否则你可以使用经典的theta-style join:
AchievementsTb