I am using JPA to query an OracleSQL database. However, I am getting the error:
Request processing failed; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: CLIENT_ID of: com.fdmgroup.pojo.File [SELECT c FROM com.fdmgroup.pojo.File c WHERE c.CLIENT_ID = :clientId]
When I write the following query
String sqlQuery = "SELECT c FROM XD_FILES c WHERE c.CLIENT_ID = :clientId";
TypedQuery<File> query = em.createQuery(sqlQuery, File.class);
query = query.setParameter("clientId", clientId);
ArrayList<File> clientFiles = (ArrayList<File>) query.getResultList();
File has this column
@ManyToOne(targetEntity = Client.class)
@JoinColumn(name = "CLIENT_ID")
private Client client;
I am unsure why as it appears to have the field "client" linked to "CLIEND_ID".