You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Robert J Celestino <Ro...@sas.com> on 2003/10/31 17:38:50 UTC

Mapping a hashmap?

Potentially stupid question, but I could not find anything on mapping a hashmap/hashtable. Consider this

	Item has an ItemPrice. 
	ItemPrice contains a HashMap of condition/price pairs. 

So you can do stuff like: 
	anItemPrice.getPriceForCondition( "Good" ) 
	anItemPrice.getPriceForCondition( "Fair" )

The itemprice table has columns: Id, ItemId, Condition, Price

Prices for item #12 would look like this in the db: 
	| 1 | 12 | Excellent | $200 |	
	| 2 | 12 | Good      | $150 |	
	| 3 | 12 | Fair      | $100 |	
	| 4 | 12 | Poor      | $50  |

Any pointers or tips for mapping ItemPrice? Specifially is there a general technique for mapping Maps using ojb? 


----------------------------------------------------------------
Bob Celestino
SAS Research and Development
919 - 531 - 9425
robertj.celestino@sas.com

SAS - The Power to Know

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org