I am currently working with IntelliJ as my IDE and the project I am working on has a composite primary key for one of the database tables.
The table is named Measurements and has its fields laid out with one being MeasurementID as @EmbeddedID. Now IntelliJ shows me an error for the two fields which make up the MeasurementID, as the datasource I have linked does not have a separate table for those IDs. How do I tell IntelliJ inspections to refer to the other table for the named columns?
public class BaseMeasurement {
@EmbeddedId
private MeasurementId measurementId;
@Column(name = "power")
private int power;
...
}
@Embeddable
public class MeasurementId implements Serializable {
static final long serialVersionUID = 1L;
@Basic(optional = false)
@Column(name = "project_id")
private int projectId;
@Basic(optional = false)
@Column(name = "timestamp")
@Convert(converter = ZonedDateTimeConverter.class)
private ZonedDateTime timestamp;
...
}
Currently both "project_id" and "timestamp" are highlighted and marked as errors. I would like to solve those - meaning having the possibility to refer / link to the right table, where it can find those columns.