log.debug("Got raw key: " + rawPK);
NSArray<String> primaryKeyAttributeNames = primaryKeyAttributeNames();
_primaryKeyDictionary = new NSDictionary<String, Object>(rawPK instanceof NSArray ? (NSArray<Object>) rawPK : new NSArray<Object>(rawPK), primaryKeyAttributeNames);
}
else {
EOEntity entity = entity();
NSArray<EOAttribute> primaryKeyAttributes = entity.primaryKeyAttributes();
// If the entity has a composite primary key, then we are
// going to make
// the assumption that we can determine its primary key from
// the values
// of the relationships that are bound to its primary key
// attributes rather
// than attempting to generate a PK with the plugin.
if (primaryKeyAttributes.count() > 1) {
NSMutableDictionary<String, Object> compositePrimaryKey = new NSMutableDictionary<String, Object>();
boolean incompletePK = false;
for (EOAttribute primaryKeyAttribute : primaryKeyAttributes) {
Object value = null;
for (EORelationship relationship : entity.relationships()) {
// .. we need to find the relationship that is
// associated with each PK attribute
if (relationship._isToOneClassProperty() && relationship.sourceAttributes().contains(primaryKeyAttribute)) {
Object obj = valueForKey(relationship.name());
if (obj instanceof ERXGenericRecord) {