We do have a problem with generating pojos from a DB using hibernate tools.
We have several tables with a composite ID, e.g. in table T100 these are the fields 'DATE_FROM' and 'UB_ID'. The Hibernate Tool generate the following pojos from that table. The problem we have is, that within the first class the Annotation '@Temporal' is used, but in the second class the Annotation is missing. The DB (IBM DB2) responds with an error without this Annotation.
Is there a possibility to force the use of @Temporal at any Date type?
table T100
Code:
@Entity
@Table(name="T100_UB"
)
public class T100Ub implements java.io.Serializable {
private T100UbId id;
private Date dateUntil;
....
@Temporal(TemporalType.DATE)
@Column(name="DATE_UNTIL", nullable=false, length=10)
public Date getDateUntil() {
return this.dateUntil;
}
...
}
table T100UbId
Code:
@Embeddable
public class T100UbId implements java.io.Serializable {
private int ubId;
private Date dateFrom;
...
@Column(name="DATE_FROM", nullable=false, length=10)
public Date getDateFrom() {
return this.dateFrom;
}
...
}