Issue Details (XML | Word | Printable)

Key: NUCCORE-1192
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Core

Assorted improvements to DatastoreId and SingleFieldId

Created: 22/Apr/14 11:12 AM   Updated: 30/Apr/15 07:43 PM
Component/s: Code Structure
Affects Version/s: None
Fix Version/s: None

 Description  « Hide
Both are for an "identity" that represents a persistable type, with a single "key". There should be much commonality.

Also SingleFieldId classes take in Class in the constructor for no reason now (could be String) - needs changing.

Also need to change ClassConstants.IDENTITY_OID_IMPL to be something like ClassConstants.DATASTORE_ID_IMPL

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 23/Apr/14 07:46 PM - edited
Problem areas are :
1. JDO javax.jdo.identity classes (that we need to convert back and forward to) uses class as arg in constructor (for no reason ... String would do); wastes space.

2. SingleFieldId doesn't have a String constructor that takes the output of toString(), and toString() doesn't include the target class name.

3. DatastoreId classes allow configuration of the toString() method, but SingleFieldId doesn't. One way around this is to have a separate handler for the string form of the id (like IdentityUtils has a method getPersistableId()) so then we could dispense with DatastoreIdKodoImpl, DatastoreIdXcaliaImpl etc also maybe

Have now removed the majority of unnecessary references to DatastoreId/SingleFieldId and use IdentityUtils instead.