<xml> </xml>

db4o |

# Db4oCollections.newHashMap Method

creates a new database-aware HashMap.

Db4oMap newHashMap(
int initialSize
);

#### Parameters

initialSize
  the initial size of the HashMap

#### Return Value

com.db4o.types.Db4oMap

#### Remarks

creates a new database-aware HashMap.
This map will call the hashCode() method on the key objects to calculate the hash value. Since the hash value is stored to the ObjectContainer, key objects will have to return the same hashCode() value in every VM session.
Usage:
- declare a

    java.util.Map

variable in your persistent class.
- fill the variable with this method.
Example:

                class MyClass{
                Map myMap;
                }
                MyClass myObject = new MyClass();
                myObject.myMap = objectContainer.ext().collections().newHashMap(0);

#### See Also

Db4oCollections Interface | com.db4o.types Namespace | com.db4o.types.Db4oMap