LegacyVirtualKeys
- Last Updated: June 24, 2022
- 1 minute read
- DataDirect Connectors
- JDBC
- MongoDB 6.1
- Documentation
Purpose
Specifies whether the driver generates legacy virtual keys for newly-discovered nested objects when mapping the relational view of data.
For versions earlier than 6.1, the driver used the naming convention object_name_GENERATED_ID for the unique virtual key column, which was used as a foreign key to associate the child table back to the parent table. Starting in version 6.1, the driver uses the POSITION column for this purpose.
By default (LegacyVirtualKeys=false), normalized schemas migrated from the 6.0 format retain the legacy key column for existing objects, while the driver generates POSITION columns for newly-discovered nested objects. To use a consistent naming convention for virtual key columns in migrated schemas, set this property to true.
Valid Values
true | false
Behavior
If set to true, the driver generates legacy virtual keys and POSITION columns when mapping newly-discovered nested objects for both new and migrated schemas. Virtual keys are populated in the object_name_GENERATED_ID column.
If set to false, the driver uses the POSITION column when mapping newly-discovered objects for both new and migrated schemas. Note that migrated schemas will continue to use the object_name_GENERATED_ID column for existing objects, but newly-discovered objects will have only the POSTION column.
Data Source Methods
public Boolean getLegacyVirtualKeys()
public void setLegacyVirtualKeys(Boolean)
Default Value
false
Data Type
Boolean