67,512
社区成员
发帖
与我相关
我的任务
分享
package com.palmcity.model;
/**
* Employeecityref entity. @author MyEclipse Persistence Tools
*/
public class Employeecityref implements java.io.Serializable {
// Fields
private EmployeecityrefId id;
// Constructors
/** default constructor */
public Employeecityref() {
}
/** full constructor */
public Employeecityref(EmployeecityrefId id) {
this.id = id;
}
// Property accessors
public EmployeecityrefId getId() {
return this.id;
}
public void setId(EmployeecityrefId id) {
this.id = id;
}
}
package com.palmcity.model;
import java.math.BigDecimal;
/**
* EmployeecityrefId entity. @author MyEclipse Persistence Tools
*/
public class EmployeecityrefId implements java.io.Serializable {
// Fields
private Long employeeid;
private String citycode;
// Constructors
/** default constructor */
public EmployeecityrefId() {
}
/** full constructor */
public EmployeecityrefId(Long employeeid, String citycode) {
this.employeeid = employeeid;
this.citycode = citycode;
}
// Property accessors
public Long getEmployeeid() {
return this.employeeid;
}
public void setEmployeeid(Long employeeid) {
this.employeeid = employeeid;
}
public String getCitycode() {
return this.citycode;
}
public void setCitycode(String citycode) {
this.citycode = citycode;
}
public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof EmployeecityrefId))
return false;
EmployeecityrefId castOther = (EmployeecityrefId) other;
return ((this.getEmployeeid() == castOther.getEmployeeid()) || (this
.getEmployeeid() != null
&& castOther.getEmployeeid() != null && this.getEmployeeid()
.equals(castOther.getEmployeeid())))
&& ((this.getCitycode() == castOther.getCitycode()) || (this
.getCitycode() != null
&& castOther.getCitycode() != null && this
.getCitycode().equals(castOther.getCitycode())));
}
public int hashCode() {
int result = 17;
result = 37
* result
+ (getEmployeeid() == null ? 0 : this.getEmployeeid()
.hashCode());
result = 37 * result
+ (getCitycode() == null ? 0 : this.getCitycode().hashCode());
return result;
}
}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="com.palmcity.model.Employeecityref" table="EMPLOYEECITYREF" schema="TRAFFICS">
<composite-id name="id" class="com.palmcity.model.EmployeecityrefId">
<key-property name="employeeid" type="java.lang.Long">
<column name="EMPLOYEEID" precision="22" scale="0" />
</key-property>
<key-property name="citycode" type="java.lang.String">
<column name="CITYCODE" length="20" />
</key-property>
</composite-id>
</class>
</hibernate-mapping>