首页>代码>寻求高质量S2SH的项目,具有标准的优化配置书写格式,用于提高学习。>/springside-3.3.4/examples/mini-service/src/main/java/org/springside/examples/miniservice/entity/IdEntity.java
package org.springside.examples.miniservice.entity;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * 统一定义id的entity基类.
 * 
 * 基类统一定义id的属性名称、数据类型、列名映射及生成策略.
 * 子类可重载getId()函数重定义id的列名映射和生成策略.
 * 
 * @author calvin
 */
//JPA 基类标识
@MappedSuperclass
public abstract class IdEntity {

	protected Long id;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE)
	//@GeneratedValue(generator = "system-uuid")
	//@GenericGenerator(name = "system-uuid", strategy = "uuid")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}
最近下载更多
GG28GG28070  LV5 2017年11月16日
cadice  LV2 2017年6月28日
刘dsfdfgd  LV5 2017年6月26日
fugetsu  LV5 2017年3月7日
veinrein  LV27 2015年4月21日
ws04152  LV40 2014年7月31日
TonyYi  LV4 2014年7月31日
江户川柯南  LV13 2014年4月22日
AXIN  LV36 2014年2月26日
君辰  LV7 2013年9月5日
最近浏览更多
张大大的账号  LV2 2022年4月26日
and123456  LV11 2022年2月14日
1798139161  LV4 2022年2月7日
0592lyj  LV9 2021年1月7日
archerK3  LV8 2020年12月25日
w2919678982  LV1 2020年12月25日
colinyi  LV1 2020年11月15日
709885402  LV4 2020年11月3日
想想未来  LV3 2020年8月3日
wob_ku  LV6 2020年7月25日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友