I'm stuck trying to implement database integration on legacy objects that will not have much added to them and will have even less change in terms of already existing fields. The initial authors decided that to keep size small(this is on an embedded system), all date and time related fields of my objects are going to be stored as Strings. This was fine and dandy for what they wanted to do, but if I want to do date comparison in the database I'm in a spot of trouble. I like timestamps, and my life will be a great deal easier if I can somehow make the strings into a timestamp without affecting my objects. It seems to me that there should be some way to have the String in my object be written as a timestamp to the database, but in all my reading and work with Hibernate I've never come across an issue like this. I've done some research on custom types, and the Hibernate book showed me things that are slightly similar, but I'm still leaning towards the "it's impossible to do this and I'd better start figuring out a workaround" routine, Are there any good guides related to custom types, or has anyone had a similar issue in their interaction with Hibernate?
For what it matters, this will be the latest Hibernate on Postgres. We'lle always use the latest Hibernate, but I'm not sure about us sticking with Postgres in the future. I'm not picky at all in terms of what sort of sql timestamp I'd get.
|