81,094
社区成员
发帖
与我相关
我的任务
分享
public class MonthPay extends BaseObject {
//本給
private int regularSalary;
//本給時間
private Date payDate;
//勤務地手当
private int areaAllowance;
//管理職手当
private int managerAllowance;
//住宅手当
private int houseAllowance;
//通勤手当
private int commutingAllowance;
//平日外手当
private int weekdayOvertimeAllowance;
//祝日外手当
private int playdayOvertimeAllowance;
//出張交通費
private int businessTrip;
//有給日数
private int workDay;
//健康保険
private int healthInsurance;
//年金保険
private int welfareInsurance;
//雇用保険
private int employmentInsurance;
//所得税
private int incomeTax;
private int advance;
//仮払旅費
private int assumeTravel;
//前払金
private int temporaryPayment;
//貸金保険料
private int loanInsurance;
//生命保険料
private int lifeInsurance;
//調整料
private int adjustment;
//控除額計
private int deduction;
//支給額計
private int provide;
//private Employee employee;
private Set <Employee> employee=new HashSet(); <------此处
。。。。。
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package = "com.m_netd.businessobjects">
<class name="MonthPay" table="month_pay">
<id name="id" type="string" column="month_pay_key">
<generator class="uuid.hex"/>
</id>
<property name="regularSalary" column="regular_salary"/>
<property name="payDate" column="pay_date"/>
<property name="areaAllowance" column="area_allowance"/>
<property name="managerAllowance" column="manager_allowance"/>
<property name="houseAllowance" column="house_allowance"/>
<property name="commutingAllowance" column="commuting_allowance"/>
<property name="weekdayOvertimeAllowance" column="weekday_overtime_allowance"/>
<property name="playdayOvertimeAllowance" column="playday_overtime_allowance"/>
<property name="businessTrip" column="business_trip"/>
<property name="workDay" column="work_day"/>
<property name="healthInsurance" column="health_insurance"/>
<property name="welfareInsurance" column="welfare_insurance"/>
<property name="employmentInsurance" column="employment_insurance"/>
<property name="incomeTax" column="income_tax"/>
<property name="advance" column="advance"/>
<property name="temporaryPayment" column="temporary_payment"/>
<property name="loanInsurance" column="loan_insurance"/>
<property name="lifeInsurance" column="life_insurance"/>
<property name="adjustment" column="adjustment"/>
<property name="deduction" column="deduction"/>
<property name="provide" column="provide"/>
<!--
<many-to-one name="employee" column="employee_key" class="Employee"></many-to-one>
-->
<set name="employee" inverse="false" cascade="all" table="employee_monthPay">
<key column="month_key"></key>
<many-to-many class="Employee" column="employee_key"></many-to-many> <------此处
</set>
</class>
</hibernate-mapping>
public class Employee extends BaseObject {
//社員NO.:
private String no;
//パースワード
private String password;
//ユーザー権限
private String level;
private EmployeeInfo employeeInfo;
//private List<MonthPay> monthPayList;
//private List<Funds> fundsList;
private Set <MonthWorkTime> monthWorksList=new HashSet();
]private Set <MonthPay> monthPayList=new HashSet();; <------此处
。。。。。。
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package = "com.m_netd.businessobjects">
<class name="Employee" table="employee">
<id name="id" type="string" column="employee_key">
<generator class="uuid.hex"/>
</id>
<property name="no" column="no"/>
<property name="password" column="password"/>
<property name="level" column="level"/>
<component name="employeeInfo" class="EmployeeInfo">
<property name="name" column="name"/>
<property name="sex" column="sex"/>
<property name="birthday" column="birthday"/>
<property name="address" column="address"/>
<property name="portableTel" column="portable_tel"/>
<property name="houseTel" column="house_tel"/>
<property name="corporationTel" column="corporation_tel"/>
<property name="email" column="email"/>
<property name="enterCompanyDate" column="enter_company_date"/>
<property name="outCompanyDate" column="out_company_date"/>
<property name="workAddress" column="work_address"/>
<property name="department" column="department"/>
<property name="position" column="position"/>
<property name="departmentTel" column="departmentTel"/>
</component>
<!--
<list name="monthPayList">
<key column="employee_key"></key>
<index column="month_pay_number"></index>
<one-to-many class="MonthPay"/>
</list>
<list name="fundsList" lazy="true">
<key column="employee_key"></key>
<index column="fusdss_number"></index>
<one-to-many class="Funds"/>
</list>
-->
<set name="monthWorksList" inverse="true" cascade="all">
<key column="employee_key"></key>
<one-to-many class="MonthWorkTime"/>
</set>
<set name="monthPayList" inverse="false" cascade="all" table="employee_monthPay">
<key column="employee_key"></key>
<many-to-many class="MonthPay" column="month_key"></many-to-many>
</set> <------此处
<!--
<list name="monthWorksList" lazy="false">
<key column="employee_key"></key>
<index column="employee_index" type="integer"></index>
<one-to-many class="MonthWorkTime"/>
</list>
-->
</class>
</hibernate-mapping>