-->
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.  [ 2 posts ] 
Author Message
 Post subject: Very complicated modeling/HQL question
PostPosted: Wed Sep 29, 2004 3:55 pm 
Newbie

Joined: Thu Aug 19, 2004 10:52 am
Posts: 14
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 04, 2004 4:28 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
if you DB has such native feature, you should consider use it through HQLdirectly or by using the query language substitution

_________________
Emmanuel


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