我正在尝试在我的代码中实现查询,如下所示:
@NamedQuery( name = "Comment.getComments",
query = "SELECT c FROM Comment c WHERE c.game=:game")
Class Comment 中包含以下代码:
@Entity
@NamedQuery( name = "Comment.getComments",
query = "SELECT c FROM Comment c WHERE c.game=:game")
public class Comment {
@Id
@GeneratedValue
private Integer ident;
private String player;
private String game;
private String comment;
@Temporal(TemporalType.DATE)
private Date commentedOn;
public Comment() {
}
public Comment(String player, String game, String comment, Date commentedOn) {
this.player = player;
this.game = game;
this.comment = comment;
this.commentedOn = commentedOn;
}
在查询注释c 中加下划线红色,我收到错误 '无法解析符号'。
我知道它与框架设置有关。
我尝试过的事情清单:
有谁知道,是什么导致了这个问题?