Android 奥姆利特外国藏品
有可能在ormlite中有这样的构造吗?如果有,我如何查询以获得第三个集合Android 奥姆利特外国藏品,android,ormlite,foreign-collection,Android,Ormlite,Foreign Collection,有可能在ormlite中有这样的构造吗?如果有,我如何查询以获得第三个集合 @DatabaseTable(tableName = "persons") public class Person { @DatabaseField(generatedId = true) private int id; @DatabaseField(canBeNull = true) private String name; @ForeignCollectionField
@DatabaseTable(tableName = "persons")
public class Person {
@DatabaseField(generatedId = true)
private int id;
@DatabaseField(canBeNull = true)
private String name;
@ForeignCollectionField
private ForeignCollection<App> apps;
}
@DatabaseTable(tableName = "apps")
public class App {
@DatabaseField(generatedId = true)
private int id;
@DatabaseField(canBeNull = true)
private String name;
@DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = "person_id")
private Person person;
@ForeignCollectionField
private ForeignCollection<New> news;
}
@DatabaseTable(tableName = "news")
public class New {
@DatabaseField(generatedId = true)
private int id;
@DatabaseField(canBeNull = true)
private String name;
public App getApp() {
return app;
}
public void setApp(App app) {
this.app = app;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = "app_id")
private App app;
}
@DatabaseTable(tableName=“persons”)
公共阶层人士{
@数据库字段(generatedId=true)
私有int-id;
@数据库字段(canBeNull=true)
私有字符串名称;
@国外收藏场
私人外汇收集应用程序;
}
@数据库表(tableName=“apps”)
公共类应用程序{
@数据库字段(generatedId=true)
私有int-id;
@数据库字段(canBeNull=true)
私有字符串名称;
@数据库字段(foreign=true,foreignAutoRefresh=true,columnName=“person\u id”)
私人;
@国外收藏场
私人收藏外国新闻;
}
@数据库表(tableName=“news”)
公共类新{
@数据库字段(generatedId=true)
私有int-id;
@数据库字段(canBeNull=true)
私有字符串名称;
公共应用程序getApp(){
返回应用程序;
}
公共void setApp(App-App){
this.app=app;
}
公共字符串getName(){
返回名称;
}
公共void集合名(字符串名){
this.name=名称;
}
公共int getId(){
返回id;
}
公共无效集合id(内部id){
this.id=id;
}
@数据库字段(foreign=true,foreignAutoRefresh=true,columnName=“app\u id”)
私人应用程序;
}
提前tnx