Skip to content

Commit 0a12505

Browse files
committed
Merge pull request #113 from whoshuu/find-by-id-int
Overload findById to take an Integer
2 parents 5ccf5e1 + 3b0db0a commit 0a12505

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

library/src/com/orm/SugarRecord.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ public static <T extends SugarRecord<?>> T findById(Class<T> type, Long id) {
151151
return list.get(0);
152152
}
153153

154+
public static <T extends SugarRecord<?>> T findById(Class<T> type, Integer id) {
155+
return findById(type, Long.valueOf(id));
156+
}
157+
154158
public static <T extends SugarRecord<?>> Iterator<T> findAll(Class<T> type) {
155159
return findAsIterator(type, null, null, null, null, null);
156160
}

0 commit comments

Comments
 (0)