Using Map and Lists. Simple
My prolem is very simple, but i'm beggining with java.
I have 10 key-values: "CUSTOMER_ID" , the others are not important
What is important is that I want to have different values under the same key CUSTOMER_ID
The structure should be like this:
Which structure can I use?
can I use Java Map?
and how to insert this values and how to load it?
Please show me simple code
sounds like a table to me. I think a tree would work. it would prevent redundant data. The tree would have several nodes (keys) then you can add leafs (values) to each node.
If you don't know what and how many "different" values you need to associate to a Customer object you should implement Customer as a class with an inner Hashtable+ArrayList to hold these values. This would require some typecasting, sorting and instanceof - coding though.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL