Added @ JoinColumn annotation in the child class, and now it looks like this -
Code:
////////////////// GbLoadForecast class //////////////////
@Entity
@Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONE)
@Table(name = "MARKSIST.GB_LOAD_FORECAST")
public class GbLoadForecast {
@Id
@Column(name = "ORG_ID")
private Integer orgId;
...
@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
@JoinColumn(name = "ORG_ID")
private GbCapacityEntity gbCapacityEntity;
/**
* @return
*/
public GbCapacityEntity getGbCapacityEntity() {
return gbCapacityEntity;
}
/**
* @param gbLoadForecast
*/
public void setGbCapacityEntity(GbCapacityEntity gbCapacityEntity) {
this.gbCapacityEntity = gbCapacityEntity;
}
...
But now another exception -
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.intellex.marksist.hbn.model.GbLoadForecast column: ORG_ID (should be mapped with insert = "false" update = "false" )The thing is, i suspect that there are a bunch of the same name of the field-name ORG_ID column is as in Table MARKSIST.GB_LOAD_FORECAST, and in the table MARKSIST.GB_CAPACITY. Or is not it?