From fc22e4dbacb5a4d006daac2d9691b156f66fdcc6 Mon Sep 17 00:00:00 2001 From: Max Klimenko Date: Mon, 28 Jul 2014 11:40:50 +0400 Subject: [PATCH] Patch for distinct --- src/com/activeandroid/util/SQLiteUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/activeandroid/util/SQLiteUtils.java b/src/com/activeandroid/util/SQLiteUtils.java index cbf41eaee..4db729b9d 100644 --- a/src/com/activeandroid/util/SQLiteUtils.java +++ b/src/com/activeandroid/util/SQLiteUtils.java @@ -325,6 +325,9 @@ public static List processCursor(Class typ TableInfo tableInfo = Cache.getTableInfo(type); String idName = tableInfo.getIdName(); final List entities = new ArrayList(); + //TODO: Это моя вставка для того чтобы работал distinct + if (cursor.getColumnCount() == 1) + idName = cursor.getColumnNames()[0]; try { Constructor entityConstructor = type.getConstructor();