Posted In: Hashmap, Java Core

Hashmap/Hashtable uses in an enterprise application – example3

Use case – We have list of objects (in this case users). We want to remove duplicate users depending on some criteria. In this example with first name and last name. We do not have source of user class. So you cannot override equals and hashcode method. Result {SuperMan=User [firstName=Super, lastName=Man], XMen=User [firstName=X, lastName=Men], RobinHood=User […]

Read More

Tags: , ,

by , on January 30th, 2017

Posted In: Hashmap, Java Core

Hashmap/Hashtable uses in an enterprise application – example2

Use case – Fetch data from database with one to many relationship. Example Fetch list of users from database. Each user can have multiple roles. We have three tables 1. USER_MASTER 2. USER_ROLE_MASTER 3. USER_ROLE_MAPPING Our User object will look like this

Read More

Tags: ,

by , on January 29th, 2017

Posted In: Hashmap, Java Core

Hashmap/Hashtable uses in an enterprise application – example1

Comparing file data You have two files. First is master file and second is subset data. Use case is to check sample data against master file and see if it is valid. For this example you have user master data. You want to check validity of sub set user data. Result [User [userId=2, age=30, firstName=Super1, […]

Read More

Tags: , ,

by , on January 26th, 2017

  • Categories