我有一个带有 Azure 表存储的数据库,我在其中存储具有各种属性的实体,并且一切运行良好。但是,当我尝试添加新属性时,它根本没有被存储。我的 InsertEntity 代码如下所示:
LunchDateEntity entity = new LunchDateEntity(ID);
try{
AppStorage storage = new AppStorage(TABLENAME);
entity.setProperty1(prop1)
entity.setProperty2(prop2)
entity.setProperty3(prop3)
entity.setNewProperty(newProp)
TableOperation operation = TableOperation.insert(entity);
m_table.execute(operation);
}
catch(...) {...}
Prop 1,2,3 是我以前拥有的实体,它们被添加到表存储中,但是,newProp 根本没有在表存储中显示。
我尝试在构建实体时对该属性进行硬编码,但无济于事。
我的实体类看起来像:
public class myEntity extends TableServiceEntity {
public static final String TABLENAME = "myTable";
public static final String PARTITION_KEY = "part1";
public String m_prop1 = "";
public String m_prop2 = "";
public String m_prop3 = "";
public String m_newProp = "";
public myEntity() {
this.partitionKey = PARTITION_KEY;
}
public void setProp1(String prop1) {
m_prop1 = prop1;
}
public String getProp1() {
return m_prop1;
}
public void setNewProp(String newProp) {
m_newProp = newProp;
}
对于所有属性,依此类推。他们都长得很像。
我是否误解了插入功能的工作原理?有什么想法为什么这不起作用?
提前致谢
Qyouu
相关分类