Comments (15)
@Ma-He
Hello there.
Can you share you mapping description and version?
I assume next case:
You've specified relationship at key "location" (let's assume")
Then Location entity get's created and passed to the cache. However, since there was no data in it - an empty Location is passed.
However, cache can't store objects without Primary Key.. so it crashes..
from fasteasymapping.
Hi,
yep, that's true. I've specified the location relationship as follows:
[mapping addRelationshipMapping:[self locationMapping]
forProperty:PersonRelationships.location
keyPath:PersonRelationships.location];
and my 'Location' mapping
+ (FEMManagedObjectMapping *)locationMapping
{
return [FEMManagedObjectMapping mappingForEntityName:[Location entityName]
configuration:^(FEMManagedObjectMapping *mapping) {
[mapping addAttributeMappingDictionary:@{LocationAttributes.locationId : @"id",
LocationAttributes.houseNumber : @"streetNumber",
LocationAttributes.streetName : @"streetname"}];
[mapping addAttributeMappingFromArray:@[LocationAttributes.city,
LocationAttributes.country,
LocationAttributes.latitude,
LocationAttributes.longitude,
LocationAttributes.zipCode]];
mapping.primaryKey = LocationAttributes.locationId;
}];
}
I'm using the current version 0.3.8
from fasteasymapping.
Basically, we don't have to create relationship if this key not found or represented as Null
Looks like a bug :)
from fasteasymapping.
That's just what I was thinking :-) First, I've assumed I've done something wrong with my mapping, but after some tests and different JSON representations it looks like a bug to me.
Thanks @poteryaysya for your help ;-)
from fasteasymapping.
@Ma-He
you can help me with pull request (if you'd like to!) ;)
i'll be ready closer to the end of the week
from fasteasymapping.
Having the same issue, had to add a null check.
from fasteasymapping.
@JacquesPienaar, @Ma-He
Just get back from my vacation.
I'll take a look in a few days
from fasteasymapping.
@Ma-He, @JacquesPienaar
Can you, guys, share JSON input for me?
Basically, it happens, when there is a mapping for some relationship, but no object presented in JSON, correct?
from fasteasymapping.
Correct
eg:
[mapping addToManyRelationshipMapping:[self promotion] forProperty:@"promotions" keyPath:@"promotions"];
json
"promotions": null
from fasteasymapping.
@JacquesPienaar thanks for help!
from fasteasymapping.
@JacquesPienaar
can reproduce it on to-one relationship, when key in JSON is missing.
it generate empty entity with nil fields. (which is obviously a bug)
from fasteasymapping.
@JacquesPienaar can you try 3e2f506?
Or give me some more info, because with NULL relationship it appears to be working correctly.
However with missing key it generated empty objects..
from fasteasymapping.
Resolved by #21
from fasteasymapping.
@Ma-He, @JacquesPienaar
I have some issues with my pod trunk session.
Meanwhile you can grab latest source by tag 0.4.0
I'll push it to the trunk as soon as permissions will be renewed
from fasteasymapping.
@Ma-He. @JacquesPienaar
0.4.1 should be available in Cocoapods, update repo :)
from fasteasymapping.
Related Issues (20)
- Data Fault HOT 3
- Relation Object added but root object store temporary not permnent HOT 1
- Load Data Takes Time
- Remove Root Object
- Mapping One object at a time HOT 1
- Crash using relationship binding by PK HOT 9
- Never ending recursion HOT 1
- What is this? When I install the pod HOT 2
- Primary key not required HOT 4
- is FastEasyMapping ready for swift 4? HOT 3
- IN Operator with no sorting
- Synchronise local and server id HOT 25
- Swift Package Manager Support HOT 1
- getting error in mapping HOT 2
- Getting crash App While Mapping
- Can not map attribute from string to Double HOT 5
- How to map a data model where the key in json is not fixed ? HOT 1
- App is crashing while trying to save data in database HOT 1
- How to map double value in Swift HOT 2
- Getting value nill after mapping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fasteasymapping.