📄 pricing.java
字号:
package com.netctoss.liping.pricing;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.*;
/**
* 该类的name是唯一的,base_fee和rate_fee 是联合唯一的
*/
@Entity
@Table(name="liping_pricing" , uniqueConstraints={@UniqueConstraint(columnNames={"base_fee","rate_fee"})})
@NamedQuery(name = "findSomePricing", query = "from Pricing p where p.id in (:ids)")
public class Pricing implements Serializable{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="pricing_id", updatable=false)
private Long id;
@Version
@Column(name="options")
private Integer option;
@Column( name="pricing_name",unique=true,nullable=false,updatable=false)
private String name;
private BigDecimal base_fee;
private BigDecimal rate_fee;
@Column( name="pricing_desc")
private String desc;
/**
* @return the id
*/
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the base_fee
*/
public BigDecimal getBase_fee() {
return base_fee;
}
/**
* @param base_fee the base_fee to set
*/
public void setBase_fee(BigDecimal base_fee) {
this.base_fee = base_fee;
}
/**
* @return the rate_fee
*/
public BigDecimal getRate_fee() {
return rate_fee;
}
/**
* @param rate_fee the rate_fee to set
*/
public void setRate_fee(BigDecimal rate_fee) {
this.rate_fee = rate_fee;
}
public String getDesc() {
return desc;
}
/**
* @param desc the desc to set
*/
public void setDesc(String desc) {
this.desc = desc;
}
/**
* @return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((base_fee == null) ? 0 : base_fee.hashCode());
result = prime * result + ((desc == null) ? 0 : desc.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result
+ ((rate_fee == null) ? 0 : rate_fee.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Pricing other = (Pricing) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
/**
* @return the option
*/
public Integer getOption() {
return option;
}
/**
* @param option the option to set
*/
public void setOption(Integer option) {
this.option = option;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -