OrmLite是否支持传递闭包表(Android Studio)?

时间:2015-04-18 07:23:41

标签: java android sqlite ormlite transitive-closure-table

我搜索过类似的问题,但还没有找到合适的答案。

我想建立一个植物分类数据库,我找到关于闭包表的this questionthis reference 。是否可以使用OrmLite框架为SQLite数据库Android项目执行此操作?如果是,我如何在我的表类中实现此结构?

这是我的课程: (不确定我的外键字段):

1。 TaxonLevel:

@DatabaseTable(tableName = "taxon_level")
 public class TaxonLevel {
    @DatabaseField(generatedId = true, id = true)
    private Long id;

    @DatabaseField(columnDefinition = "not null")
    private String level;

    @DatabaseField(foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true)
    private TaxonLevel taxonLevel;
 }

2。 TaxonItem:

@DatabaseTable(tableName = "taxon_item")
    public class TaxonItem {
        @DatabaseField(generatedId = true, id = true)
        private Long id;

        @DatabaseField(foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true)
        private TaxonItem taxonItem;

        @DatabaseField(foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true )
        private TaxonLevel taxonLevel;

        @DatabaseField(columnDefinition = "not null")
        private String taxon_name;

        @DatabaseField
        private String author;
    }

0 个答案:

没有答案