嗨我已经在我的应用程序中为sql事务实现了糖orm。我想获取由特定记录的糖orm生成的默认id。请帮助我。任何帮助将不胜感激。谢谢提前。我正在使用下面的链接糖orm。
https://github.com/satyan/sugar
我正在使用以下代码获取特定记录的获取ID
List<Book> books = new ArrayList<>();
books.add(new Book("Title here 1", "1st edition"));
books.add(new Book("Title here 2", "2nd edition"));
books.add(new Book("Title here 3", "3rd edition"));
SugarRecord.saveInTx(books);
//update
Book book = Book.findById(Book.class,1);
book.title = "john smith";
book.save();
List<Book> booksone = Book.findWithQuery(Book.class,"Select id from Book where title = ?","john smith");