You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
If there is a Java.util.date property on the entity, "Failed to instantiate model class - does it have a public null constructor?" exception is thrown.
In this case it happened because Entity.load() method swallowed IllegalArgumentExeption and replaced it with ORMDroidException.
catch (Exception e) {
throw new ORMDroidException(
"Failed to instantiate model class - does it have a public null constructor?",
e);
}
Perhaps ORMDroidException should at least print e.getClass() for the original exception?
But even then IllegalArgumentExeption does not quite indicate that there was a problem with type serialization. Needs better handling?
On the subject of dates, since util.Date, maybe it is worth serializing it (maybe not)? Azure Mobile Services handles it this way and it works quite well:
* Give more meaningful exceptions from Entity#load()
* Remove default type mapping (it doesn't work with the new load API)
* Add mapping for java.util.Date.
Thanks to rothschild86 for this bug report.
This fix brings in a (minor) API change, in that it removes the default mapping. If your code relies on it you must now set the default mapping manually using TypeMapper#setDefaultMapping.
This fix brings in a (minor) API change, in that it removes the default
mapping. If your code relies on it you must now set the default mapping
manually using TypeMapper#setDefaultMapping.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-20321048
.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If there is a Java.util.date property on the entity, "Failed to instantiate model class - does it have a public null constructor?" exception is thrown.
In this case it happened because Entity.load() method swallowed IllegalArgumentExeption and replaced it with ORMDroidException.
catch (Exception e) {
throw new ORMDroidException(
"Failed to instantiate model class - does it have a public null constructor?",
e);
}
Perhaps ORMDroidException should at least print e.getClass() for the original exception?
But even then IllegalArgumentExeption does not quite indicate that there was a problem with type serialization. Needs better handling?
On the subject of dates, since util.Date, maybe it is worth serializing it (maybe not)? Azure Mobile Services handles it this way and it works quite well:
https://github.com/WindowsAzure/azure-mobile-services/blob/master/sdk/android/src/sdk/src/com/microsoft/windowsazure/mobileservices/DateSerializer.java
The text was updated successfully, but these errors were encountered: