I have three tables as given below
TT_DATES
TT_DATE_ID (PK)
TT_DATE
DATE_RANGES
DATE_RANGE_ID(PK)
START_RANGE
END_RANGE
DATE_RANGE_EXCEPTIONS
TT_DATE_ID(PK)(FK)
DATE_RANGE_ID (PK)(FK)
I have generated annotated classes using xjb for the first two tables. But for the third table I could not generate annotated class using XJB as I am not clear as to how a composite primary key and foreign key combination could be represented in an XJB. So I have tried writing annotated classes manually for the 3rd table. Bust even this doesnot seem to work . It gives me HibernateMappingException.
Could not determine type for: datatypes.TransitTimeDateRange, for columns: [org.hibernate.mapping.Column(DateRange)
Could someone please suggest how I should write the annotated class for the 3rd table
DateRangeException :
Code:
@Entity
@Table(name = "DATE_RANGE_EXCEPTIONS")
private DateRange dateRange;
private TTDate tt_date;
@Id
@Basic(fetch = FetchType.LAZY)
@ManyToOne
@JoinColumn(name = "DATE_RANGE_ID")
public DateRange getTransitTimeDateRange() {
return dateRange;
}
public void setDateRange(DateRange dateRange) {
this.dateRange = dateRange;
}
@Id
@Basic(fetch = FetchType.LAZY)
@ManyToOne
@JoinColumn(name = "TT_DATE_ID")
public TTDate getttDate() {
return tt_date;
}
public void setttDate(TTDate tt_date) {
this.tt_date = tt_date;
}