Simple Lookup Table

All data records stored in this 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.

In the Simple lookup table wizard, you must set up the demanded properties:

In the Table definition tab, you must 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. You can select a Charset and the Initial size of the lookup table (512 by default) as wll. You can change the default value by changing the Lookup.LOOKUP_INITIAL_CAPACITY value in defaultProperties.

Simple Lookup Table Wizard

Figure 35.6. Simple Lookup Table Wizard


After clicking the button on the right side from the Key area, you will be presented with the Edit key wizard which helps you select the Key.

Edit Key Wizard

Figure 35.7. Edit Key Wizard


By highlighting some of the field names in the Field pane and clicking the Right arrow button you can move the field name into the Key parts pane. 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 the Up or Down buttons. The key parts that are higher in the list have higher priority. When you have finished, you only need to click OK. (You can also remove any of them by highlighting it and clicking the Left arrow button.)

In the Data source tab, you can either locate the file URL or fill in the grid after clicking the Edit data button. After clicking OK, the data will appear in the Data text area.

Simple Lookup Table Wizard with File URL

Figure 35.8. Simple Lookup Table Wizard with File URL


Simple Lookup Table Wizard with Data

Figure 35.9. Simple Lookup Table Wizard with Data


You can set or edit the data after clicking the Edit data button.

Changing Data

Figure 35.10. Changing Data


After all has been done, you can click OK and then Finish.

Simple lookup table are allowed to contain data specified directly in the grid, data in the file or data that can be read using LookupTableReaderWriter.

[Important]Important

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 that only one record per each key value is contained in Simple lookup table, leave the mentioned 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.