- This topic has 3 replies, 2 voices, and was last updated 16 years, 3 months ago by Riyad Kalla.
-
AuthorPosts
-
anumolaMemberWe’ve been using MyEclipse IDE for generating Hiberanate in our project. The generated hibernate mapping files have the length set as ‘7’ for the Date type columns in the xml file. We’ve deployed our application in production and seems to be working fine.
I would expect the Date field to be of length 10 if it is of ‘MM/DD/YYYY’ format or 19 if it is of ‘MM/DD/YYYY hh:mm:ss’ format. I couldn’t think of any reason how number ‘7’ can be related to a Date field. I’d think if MyEclipse is putting that value in the generated file and that there is some reason behind it. While it is assuring to know the reason behind chosing that value, most importantly I would like to know if there are any issues that are reported related to this subject. Any thoughts?
Riyad KallaMemberanumola,
Unfortunately I don’t know why Hibernate gens that value as length 7… it’s has done this for a while from what I can see, so I don’t think there is anything wrong.
You could test it easily enough I suppose by trying to enter a date of say 12/25/2008 and see if it goofs.
anumolaMemberThanks for the reply Riyad.
As I said in my original post, in our application Date fields are working fine with MM/DD/YYYY format. I’m only concerned that the length of 7 on the Date column have other limitations that we’ve not encountered yet.
So, are you saying that it is not MyEclipse that is generating the value ‘7’ in the length for the Date type columns? Instead it is Hibernate that does it?
Riyad KallaMemberSo, are you saying that it is not MyEclipse that is generating the value ‘7’ in the length for the Date type columns? Instead it is Hibernate that does it?
I believe we make use of some of the Hibernate libraries to do the field analysis when rev-eng, so I think this is one of those “If that’s the way Hibernate sees it, then it must be right” things… also considering it’s been doing it for a while and so far so good.
Sorry I don’t have a highly technical response to that, I just don’t know.
-
AuthorPosts