javaWeb中实体类中如果一个实体是List集合,请问构造器要怎么设置呢? 下面附代码:
publicRoadMaterial(StringtestYear,List<Attachment>attachments,DoubleasphaltLayer,Doub...
public RoadMaterial(String testYear, List<Attachment> attachments, Double asphaltLayer, Double asphalMaterial, Double cementLayer, Double cementMaterial, Double recyclingRate) {
this.testYear = testYear;
this.attachments = attachments;
this.asphaltLayer = asphaltLayer;
this.asphalMaterial = asphalMaterial;
this.cementLayer = cementLayer;
this.cementMaterial = cementMaterial;
this.recyclingRate = recyclingRate;
}
红框是有问题的地方。 展开
this.testYear = testYear;
this.attachments = attachments;
this.asphaltLayer = asphaltLayer;
this.asphalMaterial = asphalMaterial;
this.cementLayer = cementLayer;
this.cementMaterial = cementMaterial;
this.recyclingRate = recyclingRate;
}
红框是有问题的地方。 展开
2017-08-26
展开全部
public Test(List<Map> list){
}
List<Map> li = new ArrayList<Map>();
new Test(li);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询