roscopeco/ormdroid

ORMDroid attempts to map public static final vars

Closed this issue · 2 comments

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.

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

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

Fixed in master