public SampleViews(SampleDatabase db) {
// Use the TupleSerialFactory for a Serial/Tuple-based database
// where marshalling interfaces are used.
//
TupleSerialFactory factory = db.getFactory();
// Create map views for all stores and indices.
// StoredSortedMap is used since the stores and indices are ordered
// (they use the DB_BTREE access method).
//
partMap =
factory.newSortedMap(db.getPartDatabase(),
PartKey.class, Part.class, true);
supplierMap =
factory.newSortedMap(db.getSupplierDatabase(),
SupplierKey.class, Supplier.class, true);
shipmentMap =
factory.newSortedMap(db.getShipmentDatabase(),
ShipmentKey.class, Shipment.class, true);
shipmentByPartMap =
factory.newSortedMap(db.getShipmentByPartDatabase(),
PartKey.class, Shipment.class, true);
shipmentBySupplierMap =
factory.newSortedMap(db.getShipmentBySupplierDatabase(),
SupplierKey.class, Shipment.class, true);
supplierByCityMap =
factory.newSortedMap(db.getSupplierByCityDatabase(),
String.class, Supplier.class, true);
}