GreenDao 不创建外键?

GreenDao doesn't create foreign key?

我刚刚开始学习这个 ORM,所以也许我做错了什么。在实体中,我写了 OneToOne 关系,但 greendao 没有生成它。如果我正在为外键编写实体构造函数参数,它只会忽略它并像这样。所以table中没有属性和列。谢谢。

Public:

@Entity(active = true)
public class Public {

@Id(autoincrement = true)
Long id;

int publicId;

@ToOne(joinProperty = "id")
private Category category;  ...

@Generated(hash = 12945501)
public Public(Long id, int publicId) {
    this.id = id;
    this.publicId = publicId;
}

Public道:

public class PublicDao extends AbstractDao<Public, Long> {

public static final String TABLENAME = "PUBLIC";

/**
 * Properties of entity Public.<br/>
 * Can be used for QueryBuilder and for referencing column names.
 */
public static class Properties {
    public final static Property Id = new Property(0, Long.class, "id", true, "_id");
    public final static Property PublicId = new Property(1, int.class, "publicId", false, "PUBLIC_ID");
}    ...

/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"PUBLIC\" (" + //
            "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
            "\"PUBLIC_ID\" INTEGER NOT NULL );"); // 1: publicId
}

我的错误。我应该为其添加另一个字段,并将其写入joinProperty。