-->
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.  [ 3 posts ] 
Author Message
 Post subject: string table mapping
PostPosted: Mon Dec 12, 2005 5:29 pm 
Newbie

Joined: Mon Dec 12, 2005 5:21 pm
Posts: 4
hi,
Actually my question is very simple and basic.
I want to map a field in my class declared as follow:

class myclass {
.....

private String[] tasks; // which will hold a table of tasks
//tasks={"task1", "task2","task3", etc ....}

}

Any suggestion is very appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 5:33 pm 
Newbie

Joined: Mon Dec 12, 2005 11:37 am
Posts: 14
Well if your tasks are all strings, then my suggestions would be to just store a "comma" dilimited string.

And then modify you getTasks method to do a String.split(",") to get back the array.

But if your Tasks are actual objects (with other parameters), then you shoudl have a Map or some kind of collection to hold it and use a separate table.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 6:00 pm 
Newbie

Joined: Mon Dec 12, 2005 5:21 pm
Posts: 4
shanripper thank you for your reply,
A separate table might be more efficient, I guess.


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