のために期待されるパス、私はこの例外HQL左が参加 - org.hibernate.hql.internal.ast.ErrorCounterを - 以下のコードを実行している間に参加
ERRORのorg.hibernate.hql.internal.astを得ました。 ErrorCounter - パスが必要です
DBビューのエンティティクラス:DBテーブルの
@NamedQueries({
@NamedQuery(name = "find",
query = "SELECT v.cxxx, trk.cxxx, trk.ixxx"
+ "FROM AxxxCxxx as v LEFT JOIN AxxxCxxxTxxx as trk "
+ "ON v.cxxx = trk.cxxx "
)
})
@Entity
@Table(name = "V_XXX")
public class AxxxCxxx implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "CXXX")
private String cxxx;
//getter, setter
}
Entity1クラス:
@Entity
@Table(name = "T_XXX")
public class AxxxCxxxTxxx extends Super implements
Serializable {
private static final long serialVersionUID = 1L;
@Column(name = "CXXX")
private String cxxx;
//getter, setter
}
スーパークラス:
@MappedSuperclass
public abstract class Super implements Serializable {
private static final long serialVersionUID = -1413197336548058176L;
@Id
@Column(name = "TXXX", nullable = false)
private Integer txxx;
@Column(name = "IXXX", length = 15)
private String ixxx;
//getter, setter
}
私はNamedQueryを実行しようとすると、この例外があります:
Caused by: org.hibernate.HibernateException: Errors in named queries: find
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:504)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802)
... 26 more
org.hibernate.hql.internal.ast.QuerySyntaxException: Path expected for join! [SELECT v.cxxx, trk.cxxx, trk.ixxx"
+ "FROM AxxxCxxx as v LEFT JOIN AxxxCxxxTxxx as trk "
+ "ON v.cxxx = trk.cxxx]
org.hibernate.hql.internal.ast.InvalidPathException: Invalid path: 'trk.ixxx'
at org.hibernate.hql.internal.ast.util.LiteralProcessor.lookupConstant(LiteralProcessor.java:114) ~[hibernate-core-5.0.5.Final.jar:5.0.5.Final]
誰かが私を助けることができますか? JPQL for MappedSuperClassを使用して、ビューとテーブルで左結合を解決するにはどうすればよいですか?