Android 用于SQL Lite的橱柜,用于在一列上设置唯一字段

Android 用于SQL Lite的橱柜,用于在一列上设置唯一字段,android,database,sqlite,unique,Android,Database,Sqlite,Unique,我正在为android项目使用橱柜。这个项目非常简单,但后来我需要在我的类中将一些字段设置为唯一列 例如: 我不知道该怎么做。最近橱柜解决了这个问题: class book { Long _id; String name; // this name should be unique String auther; }

我正在为android项目使用橱柜。这个项目非常简单,但后来我需要在我的类中将一些字段设置为唯一列

例如:


我不知道该怎么做。

最近橱柜解决了这个问题:

class book {
Long _id;
String name; // this name should be unique 
String auther;
}