2

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.

Netsky
  • 31
  • 2
  • 8
  • 2
    Seems currently it's not possible. Please vote for the related issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-19017 – y.bedrov Apr 11 '19 at 11:17
  • I was unaware of that issue, thank you for showing it to me :) – Netsky Apr 11 '19 at 13:39

0 Answers0