我有一个在JBoss EAP 6.0中运行的EJB应用程序。 我们正在尝试(最终)移植到更新的版本(6.4或7.0),但在这两种情况下,我都遇到了NamedQueries的问题。
我有一个bean(为简洁起见,删除了许多属性):
@Entity
@Table(name = "ArtMove")
@NamedQueries({@NamedQuery(name = "byStoreAndExternCode", query = "from ArticleMove o where o.properties.status='A' and o.externCode=:extcode and o.store.id=:storeid")})
public class ArticleMove{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Version
private short version = 0;
@Embedded
private RowProperties properties;
}
RowProperties的位置(为简洁起见,删除了许多属性)
@Embeddable
public class RowProperties implements IRowProperties {
@Column(length = 1, nullable = false)
@Enumerated(EnumType.STRING)
private RowStatus status;
}
部署后,我遇到以下错误:
HHH000177: Error in named query: byStoreAndExternCode: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: o near line 1, column 43 [from ch.oasi.xlnet.eb.ArticleMove o where o.properties.status='A' and o.externCode=:extcode and o.store.id=:storeid]
在JBoss EAP 6.0中一切正常。 我在网上搜索但找不到解决方案。任何帮助表示赞赏。