-->
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.  [ 4 posts ] 
Author Message
 Post subject: Custom mapping types
PostPosted: Mon Feb 14, 2005 6:24 pm 
Newbie

Joined: Fri Feb 11, 2005 2:13 pm
Posts: 11
RI have read section 6.1.2 on using mappting types, and create user types. The example is about combining 2 columns into one type. Are there any examples for splitting a column into multiple properties? In our database, a very legacy system, the original designers "overloaded" char columns. Somewhat difficult to explain this whorked up database. But, the short ot it, we need to split up these char columns into smaller pieces. Which is totally possible using Informix sql, but we sure would like to hide that from the business level developer.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 4:48 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Uhm, thats just the same as using several columns, with a different routine in nullSafeGet() and nullSafeSet().


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 1:40 pm 
Newbie

Joined: Fri Feb 11, 2005 2:13 pm
Posts: 11
Ok, I understand that.

The issue is that we would have to retrieve the entire column from the database, then in the nullSafeGet() we would split up the column.

Say we have a column in a table(t1) and it has a char column called 'other' that has a zise of 256. We want to do a select a segment of the column. In Informix SQL, for example, we can do the following:

select t1.other[200,250] info from tl where t.other[200,250]= "some info"

In this case the "splitting' of the column information is done at the database level. In the case of the examples for Hibernate Custom Types it is done at the Java level. This would be ok, but how do we query in there "where" statement on the partial column as the query above illustrates? I may be missing something obvious here.

It seems to me, that for retrieving information using Hibernate, as we want, is a viable solution only if the partial column is not part of the Where clause.

Thanks for the help so far.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 2:11 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This is a good question for the normal Hibernate User forum, I only have time for book and CaveatEmptor questions here.


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