2012-10-25 65 views
5

我一直在試圖創建一個數據庫,其中所有表都繼承了某個元素,以便有可能具有元數據。如何在GreenDao中實現表繼承

那裏我在模型生成器加入所有的表聲明,該行:

public Entity addSuperEntity(Schema schema) { 
    Entity superEntity = schema.addEntity("superEntity"); 
    superEntity.addIdProperty().primaryKey(); 
    // SET RELATIONSHIP 1:m TO META DATA 
} 

public Entity addTable(Schema schema) { 
    Entity mEntity = schema.addEntity("MyEntity"); 
    mEntity.setSuper("superEntity"); 
    mEntity.addIdProperty().PrimaryKey(); 
    // REST OF FIELDS 
} 

的問題是:

現在我生成這個對我的Android項目後

,我怎麼能確保這仍然發生在現實生活中?我現在需要改變什麼嗎?

官方文檔沒有任何關於繼承的內容。

回答