-->
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: Custom Value Type for Columns with Comma Seperated Values?
PostPosted: Thu Jan 08, 2004 10:13 am 
Regular
Regular

Joined: Tue Jan 06, 2004 3:32 pm
Posts: 80
Location: Munich, Germany
I've got a legacy database model that frequently uses columns with comma seperated String enumerations, like "cat,dog,bird".

I can't change the db model, but from my object model I'd like to access the list of values stored in one of these columns like a Collection, e.g. I want to use get(), append(), insert(), remove() and iterator().

toString() should yield the original value.

My first thought was to implement a Custom Value Type that internally uses java.util.StringTokenizer. Is this doable? Maybe someone's already implemented it and could post the code?

Where can I get examples for custom value types?

Regards,

Andreas


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2004 8:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
This should be doable I think. Just look at the source in net.sf.hibnerate.type, writing a CustomType is not that difficult.


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.