My app processes data from multiple vendors whose formats vary slightly. 99% of the fields are of the same type, but a few vary. For instance, transaction codes are alpha in some, and numeric in others. For business reasons, it was decided that our actual databases at customer sites would reflect these differences.
I currently have a home-grown data layer that takes that into account. This allows my application to treat all such "morphable" fields as Strings internally. Therefore, I have a single code base that works against a variety of slightly different databases. When my application asks my data layer to persist a transaction code, for example, it first queries the metadata of the local database, and then persists it either as a string or as an integer. It reverses the process when I retrieve it.
I'm telling you all this because I'm considering switching to Hibernate. (Like you folks told me to several years ago.) I don't know much about Hibernate yet, but that would be the key question.
Can my app tell Hibernate: Take this String, and persist it to some local db field, and if that db field is an integer, first convert the String to an integer?
If so, can you give me an idea of how to go about it, and how much trouble it would be? ( We only have about six such fields we really care about.)