Im new to JPA Query and my JPA Self Inner Join on the same table is not working but the SQL query works
This is the JPA query Im using
SELECT T.codeAuth FROM CodeCm T INNER JOIN Codecm K ON T.langCode = K.langCode where K.code= code1 and K.codeGroup =
code_group1 and T.code= code1 and T.codeGroup= code_group1 ;
My columns
@Basic()
@Column(name="CODE", nullable=false, length=20)
private String code;
@Basic()
@Column(name="CODE_GROUP", length=20)
private String codeGroup;
@Basic()
@Column(name="LANG_CODE", length=2)
private String langCode;
The exception Im getting is
org.apache.openjpa.persistence.ArgumentException: Encountered "INNER JOIN Codecm K" at character 33, but expected: [".", "FETCH", "INNER", "JOIN", "LEFT", <IDENTIFIER>].