roscopeco / ormdroid

ORMDroid is a simple ORM persistence framework for your Android applications.
http://roscopeco.github.io/ormdroid/
Apache License 2.0
86 stars 24 forks source link

ORMDroid attempts to map public static final vars #4

Closed ronnyek closed 11 years ago

ronnyek commented 11 years ago

android frequently uses int/string constants instead of enum's.. .attempting any setting of these causes expected errors.

ex

public class User{ public final static int USER_TYPE_ADMIN = 0; public final static int USER_TYPE_SUPERADMIN=1;

public int userType;

}

I had to move the constants out into another class, then deserializing from db worked properly again.

Perhaps we should ignore, or if we can access protection levels and whether or not its static / non-static, we should automatically ignore said fields? (we'll never be able to set a static var like the actual USER_TYPE_ADMIN in this case).

Otherwise we could put together an ignore annotation for explicit ignoring.

roscopeco commented 11 years ago

This is a bug - we should definitely ignore all non-public, non-instance fields.

I'll put together a fix for this later today.

roscopeco commented 11 years ago

Fixed in master