-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: @Temporal missing in classes / pojos
PostPosted: Thu Dec 18, 2008 8:18 am 
Newbie

Joined: Thu Dec 18, 2008 7:30 am
Posts: 1
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;
     }
...
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 24, 2008 3:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
surprised it is generated differently. Report a bug in jira.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.