首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

ManyToOne 事例

2013-06-25 
ManyToOne 例子import java.util.Dateimport javax.persistence.Columnimport javax.persistence.Entity

ManyToOne 例子
import java.util.Date;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.JoinColumn;import javax.persistence.ManyToOne;import javax.persistence.Table;import org.foreveross.tms.core.OrgnizationsEntity;import org.foreveross.tms.core.TmsUserEntity;import com.dayatang.domain.AbstractEntity;@Entity@Table(name="TB_SYS_LOGS")public class SysLogsEntity extends AbstractEntity {@ManyToOne@JoinColumn(name="ORG_ID", nullable=false)private OrgnizationsEntity orgnizationsEntity;public OrgnizationsEntity getOrgnizationsEntity() {return orgnizationsEntity;}public void setOrgnizationsEntity(OrgnizationsEntity orgnizationsEntity) {this.orgnizationsEntity = orgnizationsEntity;}public TmsUserEntity getTmsUserEntity() {return tmsUserEntity;}public void setTmsUserEntity(TmsUserEntity tmsUserEntity) {this.tmsUserEntity = tmsUserEntity;}@Column(name="LOG_INFO")private String logInfo;@ManyToOne@JoinColumn(name="OPERATE_USER_ID", nullable=false)private TmsUserEntity tmsUserEntity;@Column(name="OPERATE_DATE")private Date operateDate;@Overridepublic int hashCode() {// TODO Auto-generated method stubreturn 0;}@Overridepublic boolean equals(Object other) {// TODO Auto-generated method stubreturn false;}public String getLogInfo() {return logInfo;}public void setLogInfo(String logInfo) {this.logInfo = logInfo;}public Date getOperateDate() {return operateDate;}public void setOperateDate(Date operateDate) {this.operateDate = operateDate;}@Overridepublic String toString() {// TODO Auto-generated method stubreturn null;}}

?

热点排行