Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

How to store this (key1,key2, Object) ?

Thread view: 
exquisitus - 04 May 2005 16:13 GMT
Is there a data type in the JDK (1.4) that allows me to do this (and
also retieve) or do I have to roll my own?

tks
Thomas Kellerer - 04 May 2005 16:20 GMT
> Is there a data type in the JDK (1.4) that allows me to do this (and
> also retieve) or do I have to roll my own?
>
> tks

What about storing (key1 + "<delimiter>" + key2, Object)

Thomas
exquisitus - 04 May 2005 16:45 GMT
Thanks Thomas, this is probably the simplest way to do what I want to do

>>Is there a data type in the JDK (1.4) that allows me to do this (and
>>also retieve) or do I have to roll my own?
[quoted text clipped - 4 lines]
>
> Thomas
Roland - 04 May 2005 16:22 GMT
> Is there a data type in the JDK (1.4) that allows me to do this (and
> also retieve) or do I have to roll my own?
>
> tks

No and No.
You could use Apache Commons Collections' MultiKeyMap
<http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_1/org/apache
/commons/collections/map/MultiKeyMap.html
>
<http://jakarta.apache.org/commons/collections/>
Signature

Regards,

Roland de Ruiter
  ___      ___
 /__/ w_/ /__/
/  \ /_/ /  \

exquisitus - 04 May 2005 16:40 GMT
Thanks Roland. Can I use the MultikeyMap in a session EJB?

>> Is there a data type in the JDK (1.4) that allows me to do this (and
>> also retieve) or do I have to roll my own?
[quoted text clipped - 6 lines]
>
> <http://jakarta.apache.org/commons/collections/>
Roland - 04 May 2005 16:49 GMT
>>> Is there a data type in the JDK (1.4) that allows me to do this (and
>>> also retieve) or do I have to roll my own?
[quoted text clipped - 8 lines]
>
> Thanks Roland. Can I use the MultikeyMap in a session EJB?

Yes, if you deploy the jar with the Commons Collections to your J2EE
server and if MultiKeyMap is serializable (let me check... yes it
implements java.io.Serializable) and all keys/items you store in the map
are too, then I wouldn't know a reason why you couldn't.
Signature

Regards,

Roland de Ruiter
  ___      ___
 /__/ w_/ /__/
/  \ /_/ /  \

exquisitus - 04 May 2005 16:52 GMT
Thanks Roland, I appreciate your quick response. Very helpful

>>>> Is there a data type in the JDK (1.4) that allows me to do this (and
>>>> also retieve) or do I have to roll my own?
[quoted text clipped - 13 lines]
> implements java.io.Serializable) and all keys/items you store in the map
> are too, then I wouldn't know a reason why you couldn't.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.