I have the following hibernate query string:
String queryString = "select \r\n" +
"cms.my_status_id as 'myStatusId',\r\n" +
"cms.status_label as 'statusLabel',\r\n" +
"csl.status_id as 'companyStatusLabel'\r\n" +
"from "+client+".corresponding_status cms \r\n" +
"join "+client+".company_status_label csl on csl.status_id = cms.my_status_id";
My Corresponding Entity is:
@Entity(name = "corresponding_status")
@Table(name = "corresponding_status")
public class CorrespondingStatus implements Serializable {
@Id
@JsonProperty
@Column(name = "my_status_id")
private Integer myStatusId;
// varchar(255)
@JsonProperty
@Column(name = "status_label")
private String statusLabel;
@JsonProperty
@Transient
private String companyStatusLabel;
However when I run the query I get:
Column 'my_status_id' not found
even though it is definitely in the DB.
What is the issue here?
\r\nare completely unnecessary and might be causing issuesCorrespondingStatusentity does not appear to have relationships to any other entities. Why are you trying to do a join here?