Simple Lookup Table
All data records stored in simple lookup table are kept in memory. For this reason, to store all data records from the lookup table, sufficient memory must be available. If data records are loaded to a simple lookup table from a data file, the size of the available memory should be approximately at least 6 times bigger than that of the data file. However, this multiplier is different for different types of data records stored in the data file.
Simple lookup table allows storing multiple data records with the same key value. If you do not allow storing duplicated values, the last value will be stored.
Creating Simple Lookup Table
In the first step of the wizard, choose Simple lookup.
In the next step, set up the required properties: in the Table definition tab, give a Name to the lookup table, select the corresponding Metadata and the Key that should be used to look up data records from the table.
Optionally, you can select a Charset
and the Initial size of the lookup table (512 by default).
You can change the default value by changing the
Lookup.LOOKUP_INITIAL_CAPACITY value in
Figure 34.2. Simple Lookup Table Wizard
After clicking the button on the right side from the Key area, you will be presented with the Edit key dialog which helps you select the Key. The list on the left side contains metadata fields and their data types. The list on the right side contains metadata fields that form the key.
Figure 34.3. Edit Key Wizard
To add a metadata field to the key, drag the field from the list on the left and drop it to the list on the right. Any highlighted metadata field can be added to the list with an arrow too.
You can move the field name(s) into the Key parts pane by highlighting the field name(s) in the Field pane and clicking the button. You can keep moving more fields into the Key parts pane.
You can also change the position of any of them in the list of the Key parts by clicking theor buttons. The key parts that are higher in the list have higher priority. When you have finished, you only need to click .
You can also remove any key part by highlighting it and clicking thebutton.
Data Source Tab
In the Data source tab, you can either locate the file URL or fill in the grid after clicking the button. After clicking , the data will appear in the Data text area. If you use LookupTableReaderWriter to fill in the table, you do not need to specify data on the Data source tab.
Figure 34.4. Simple Lookup Table Wizard with File URL
Figure 34.5. Simple Lookup Table Wizard with Data
You can set or edit the data after clicking thebutton.
Figure 34.6. Changing Data
After that, clickand then .
Simple lookup table is allowed to contain data specified directly in the grid, data in the file or data that can be read using LookupTableReaderWriter.
Remember that you can also check the Allow key duplicates checkbox. This way, you are allowing multiple data records with the same key value (duplicate records).
If you want to have only one record per each key value in Simple lookup table, leave the checkbox unchecked (the default setting). If only one record is selected, new records overwrite the older ones. In such a case, the last record is the only one that is included in Simple lookup table.