我尝试使用 RapidClipseX 和 MicroStreamDB。我生成了一个存储,在不同的表对象中导入了不同的数据。现在我想读取数据并在 RapidClipseX Grid 组件中将其可视化。
通过使用 MicroStreamDB,我没有像 hibernate 那样的 DAO 对象。我仍然不知道该怎么做。RapidClipseX 文档中也没有可用的示例,Microstream 文档中也没有。
我尝试使用以下分配,它仍然填充网格。但它用大约 6000 行填充网格,这仍然是表中的行数。但是每一行的内容都是一样的,仍然是db-table中最后保存的一行。(我仍然通过文本编辑器检查,如果 MicrostreamDB 存储了正确的数据。--> 是的,它有)
private void grid_onAttach(final AttachEvent event)
{
final dataRoot root = dbHandler.getRoot();
this.grid.setDataProvider(DataProvider.ofCollection(root.getAllUmsClassifications()));
}
这是我使用过的表的类:
package com.opaheinz.rcx_test.dbmodel;
import static javax.persistence.GenerationType.IDENTITY;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.rapidclipse.framework.server.resources.Caption;
/**
* msTUmsatzClassification
*/
public class msTUmsatzClassification
{
private Integer id;
private Integer UId;
private Integer pos;
private Integer l2Id;
private Integer l3Id;
private Integer l1Id;
private String rule;
private Date datum;
private double sbetrag;
private double dbetrag;
private Integer fixedCosts;
@Caption("Id")
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false, columnDefinition = "INTEGER")
public Integer getId()
{
return this.id;
}
public void setId(final Integer id)
{
this.id = id;
}
@Caption("UId")
@Column(name = "u_id", nullable = false, columnDefinition = "INTEGER")
public Integer getUId()
{
return this.UId;
}
public void setUId(final Integer UId)
{
this.UId = UId;
}
@Caption("Pos")
@Column(name = "pos", nullable = false, columnDefinition = "INTEGER")
public Integer getPos()
{
return this.pos;
}
public void setPos(final Integer pos)
{
this.pos = pos;
}
@Caption("L2Id")
@Column(name = "L2_id", columnDefinition = "INTEGER")
public Integer getL2Id()
{
return this.l2Id;
}
public void setL2Id(final Integer l2Id)
{
this.l2Id = l2Id;
}
@Caption("L3Id")
@Column(name = "L3_id", columnDefinition = "INTEGER")
public Integer getL3Id()
{
return this.l3Id;
}
public void setL3Id(final Integer l3Id)
{
this.l3Id = l3Id;
}
@Caption("L1Id")
@Column(name = "L1_id", nullable = false, columnDefinition = "INTEGER")
public Integer getL1Id()
{
return this.l1Id;
}
public void setL1Id(final Integer l1Id)
{
this.l1Id = l1Id;
}
@Caption("Rule")
@Column(name = "rule", nullable = false, columnDefinition = "VARCHAR", length = 100)
public String getRule()
{
return this.rule;
}
public void setRule(final String rule)
{
this.rule = rule;
}
@Caption("Datum")
@Temporal(TemporalType.DATE)
@Column(name = "datum", nullable = false, columnDefinition = "DATE", length = 10)
public Date getDatum()
{
return this.datum;
}
public void setDatum(final Date datum)
{
this.datum = datum;
}
@Caption("Sbetrag")
@Column(name = "sBetrag", nullable = false, columnDefinition = "DOUBLE", precision = 22, scale = 0)
public double getSbetrag()
{
return this.sbetrag;
}
public void setSbetrag(final double sbetrag)
{
this.sbetrag = sbetrag;
}
@Caption("Dbetrag")
@Column(name = "dBetrag", nullable = false, columnDefinition = "DOUBLE", precision = 22, scale = 0)
public double getDbetrag()
{
return this.dbetrag;
}
public void setDbetrag(final double dbetrag)
{
this.dbetrag = dbetrag;
}
@Caption("FixedCosts")
@Column(name = "fixedCosts", columnDefinition = "INTEGER")
public Integer getFixedCosts()
{
return this.fixedCosts;
}
public void setFixedCosts(final Integer fixedCosts)
{
this.fixedCosts = fixedCosts;
}
}
以下代码是我的dataRoot:
package com.opaheinz.rcx_test.dbstorage;
import java.util.ArrayList;
import java.util.List;
import com.opaheinz.rcx_test.dbmodel.msTCabinet;
import com.opaheinz.rcx_test.dbmodel.msTCabinetList;
import com.opaheinz.rcx_test.dbmodel.msTUmsatzClassification;
import com.opaheinz.rcx_test.dbmodel.msTgroup;
public class dataRoot
{
private msTCabinet msTCabinet;
private msTCabinetList msTCabinetList;
private msTgroup msTgroup;
private msTUmsatzClassification msTUmsatzClassification;
private final List<msTCabinet> cabinets = new ArrayList<>();
private final List<msTCabinetList> allCabinets = new ArrayList<>();
private final List<msTgroup> allGroups = new ArrayList<>();
private final List<msTUmsatzClassification> allUmsClassifications = new ArrayList<>();
public msTCabinet getMsTCabinet()
{
return this.msTCabinet;
}
public void setMsTCabinet(final msTCabinet msTCabinet)
{
this.msTCabinet = msTCabinet;
}
public List<msTCabinet> getCabinets()
{
return this.cabinets;
}
public msTCabinetList getMsTCabinetList()
{
return this.msTCabinetList;
}
public void setMsTCabinetList(final msTCabinetList msTCabinetList)
{
this.msTCabinetList = msTCabinetList;
}
public List<msTCabinetList> getAllCabinets()
{
return this.allCabinets;
}
public msTgroup getMsTgroup()
{
return this.msTgroup;
}
public void setMsTgroup(final msTgroup msTgroup)
{
this.msTgroup = msTgroup;
}
public List<msTgroup> getAllGroups()
{
return this.allGroups;
}
public msTUmsatzClassification getMsTUmsatzClassification()
{
return this.msTUmsatzClassification;
}
public void setMsTUmsatzClassification(final msTUmsatzClassification msTUmsatzClassification)
{
this.msTUmsatzClassification = msTUmsatzClassification;
}
public List<msTUmsatzClassification> getAllUmsClassifications()
{
return this.allUmsClassifications;
}
}
出了什么问题,问题出在哪里?任何帮助/想法/示例将不胜感激。rgds 奥帕海因茨