java 类设置id生成策略

public class Data_Brand  implements Serializable  {
//5.2.60 
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;//自序ID,默认生成策略

private String Brand_Name;//品牌名称brandName  brand_name

}

 

@Entity


@Table
public class Data_cp implements Cloneable{
@Id
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator" )
     private String cpdm;//平台系统代码 生成策略为UUid
     private String code;

}

上一篇:nginx作为负载均衡(代理转发)时的配置文件样例nginx.conf


下一篇:浅析几种设计模式--策略模式