I have a repository method like
@Query("from Application app where app.id.hostId = :hostId")
List<Application> getApplicationsByApplicationId(@Param("hostId") String hostId);
And my domain class reads something like
public class Application {
@EmbeddedId
Composite id;
...
...
@Embeddable
public static class Composite implements java.io.Serializable {
@Column(name = "id")
private String id;
@Column(name = "hostId")
private String hostId;
....
Somewhere down the processing chain, hostId
string gets transformed to host_id
, So I get an error like
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'application0_.host_id' in 'field list'.
I am trying to migtate an existing hibernate / JPA layer into Spring Boot JPA. Any pointers will be greatly appreciated.