-->
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.  [ 3 posts ] 
Author Message
 Post subject: A calculated date propery out of 3 (d,m,y) table columns
PostPosted: Fri Jun 03, 2005 11:07 am 
Beginner
Beginner

Joined: Tue May 10, 2005 4:18 am
Posts: 29
Dear All
I would like to ask if your experience can offer me some solution:
I have a legacy table with 3 INT columns for a date - Day Month and Year.

This is done because many records do not have a specific day or month when they occur.

My question is what would you suggest me to define as my class fields ?
3 fields with type int ? 3 with type date ? something else ?

Maybe someone has implemented something similar and can offer me a direction.

Thank you !

Elad


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 11:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
If you wanted to use an actual Date in your object model, you could accomplish this through Hibernate by using a UserType. The problem, though, would be the fact that it sounds like some of these "dates" are not really dates (if they only contain a year component).

In that case, I'd prebably map this as a component using a custom date representation.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Fri Jun 03, 2005 11:42 am 
Beginner
Beginner

Joined: Tue May 10, 2005 4:18 am
Posts: 29
Yes. Sometimes only the year will be there. It might happen.

I will look into the "Component" documantation to learn how I can use it.

Thanks for the quick response!

Elad


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.