public class Classes implements Serializable{

本文介绍了一个Java实体类——Classes, 它用于表示班级信息,并包含与学生的一对多关联关系。该类实现了Serializable接口,拥有班级ID、名称、描述及学生集合等属性。
package com.tfy.heibernate.mangtoone;


import java.io.Serializable;
import java.util.Set;


public class Classes implements Serializable{


private Long cid;
private String cname;
private String description;
private Set<Student> students;
public Long getCid() {
return cid;
}
public void setCid(Long cid) {
this.cid = cid;
}
public String getCname() {
return cname;
}
public void setCname(String cname) {
this.cname = cname;
}
public Set<Student> getStudents() {
return students;
}
public void setStudents(Set<Student> students) {
this.students = students;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}

}
// Step 1: Define the Operation interface. public interface Operation { public double apply(double num1, double num2); } // Step 2: Implement concrete strategy classes for each operation type. // Addition class implements addition logic. class AddOperation implements Operation { @Override public double apply(double num1, double num2) { return num1 + num2; } } // Subtraction class implements subtraction logic. class SubtractOperation implements Operation { @Override public double apply(double num1, double num2) { return num1 - num2; } } // Multiplication class implements multiplication logic. class MultiplyOperation implements Operation { @Override public double apply(double num1, double num2) { return num1 * num2; } } // Division class implements division logic with error handling. class DivideOperation implements Operation { @Override public double apply(double num1, double num2) throws ArithmeticException { if (num2 == 0){ throw new ArithmeticException("Cannot divide by zero."); }else{ return num1 / num2; } } } // Step 3: Create Context which uses an 'operation' object to perform actions on inputs given by user/client side code. public class CalculatorContext { private final Operation operation; // Constructor receives any subclass instance implementing Operation Interface as argument. public CalculatorContext(Operation opType){ this.operation=opType; } // Method invokes method defined inside passed Object during initialization phase above via constructor call. public double executeStrategy(double operandOne,double operandTwo)throws Exception{ return operation.apply(operandOne , operandTwo ); } }Main.java:2: error: interface Operation is public, should be declared in a file named Operation.java public interface Operation { ^ Main.java:45: error: class CalculatorContext is public, shou
03-15
一直提示:java: No property named "userId" exists in source parameter(s). Type "TSaleAwardUpdateReq" has no properties. 可是 我的实体类中有这个属性@Data public class TSaleAwardUpdateReq implements Serializable { private static final long serialVersionUID = 1L; /** * 主键ID */ private Long id; /** * 奖项类别 0:奖励1:扣款 */ private Integer awardType; /** * 是否为门店退款 1是,0不是 */ private Integer isOffline = -1; /** * 用户id */ private Long userId; //不能看比自己级别高的奖励或扣款 private Integer userTypeMax; /** * 部门ID */ private Long deptId; private List<Long> deptIds; /** * 分组ID */ private Long teamId; /** * 奖励金额 */ private BigDecimal awardMoney = BigDecimal.ZERO; /** * 奖励时间 */ private Date awardDate; /** * 奖励时间开始 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date awardDateStart; /** * 奖励时间结束 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date awardDateEnd; /** * 状态:1:已通过2:已支付 */ private Integer awardStatus; /** * 排序默认:0-不排序 1-排序 */ private byte sorted; /** * 主键ID集合 */ private List<Long> ids; /** * 备注 */ private String remark; /** * 异议描述 */ private String objectionDescription; /** * 审核状态:0-待审核;1-已审核;2-已拒绝;3-有异议;4-驳回异议; */ private Integer auditStatus; private List<Integer> shenheStates; /** * 门店ID */ private Long shopId; private Byte shopType; /** * 门店IDs */ private List<Long> shopIds; /** * 审批人id */ private Long auditUserId; private Long defaultUserId; private String createUserName; private boolean isExport; private Integer type; }
最新发布
09-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值