There is possibility of getting 'duplicate' entries in DataRowStore.snapshots by using SelectQuery and ObjectIdQuery.
For example if we have database table 'items', with short primary key item_id, when we do the following DataRowStore will have duplicate entries:
1. get item by Short id with SelectQuery
2. get item via DataObjectUtils.objectForPk with String for PK
The second query successfully fetches object from database even though it uses String datatype for PK, but it creates different ObjectID - with string instead of short.
This creates some confusion because now DataRowStore holds duplicate entries for one database row.
ObjectIdQuery should probably check for correct datatype of pk to prevent this situation?
Description
There is possibility of getting 'duplicate' entries in DataRowStore.snapshots by using SelectQuery and ObjectIdQuery.
For example if we have database table 'items', with short primary key item_id, when we do the following DataRowStore will have duplicate entries:
1. get item by Short id with SelectQuery
2. get item via DataObjectUtils.objectForPk with String for PK
The second query successfully fetches object from database even though it uses String datatype for PK, but it creates different ObjectID - with string instead of short.
This creates some confusion because now DataRowStore holds duplicate entries for one database row.
ObjectIdQuery should probably check for correct datatype of pk to prevent this situation?