Hibernate version:
2.1.6 or 3.0cvs
Mapping documents:
I am trying to map a very oddly structured legacy database into something that is more or less a clean object model.
I have most of the model in hibernate and it works well, but i have one big stumbling block which makes the model non-transparent:
In our DB, we store 'null' as some types of elements, and as '1' for other types of elements. For each new project that we add to our system, a new DB table is created, with columns for each element.
What i would like to be able to do is use HQL to look things up like this:
form.element1 == null
and have this translate to
form.element1 == null or form.element1 == 1 depending on what element type element1 is listed as.
The other requirement is that we cannot have new beans for every new project, so there needs to a single class that is refered to by all the code.
I realize that this is very complicated, but would like to either find a solution or work on Hibernate in order to be able to implement a solution.
I do know of UserTypes and CompositeUsers types, and have implemented something, but was not able to get this functionality.
|