MysqlLongIdEntity.java 575 B

1234567891011121314151617181920212223242526272829
  1. package com.jeff.tianti.common.entity;
  2. import javax.persistence.GeneratedValue;
  3. import javax.persistence.GenerationType;
  4. import javax.persistence.Id;
  5. import javax.persistence.MappedSuperclass;
  6. /**
  7. * Mysql数据库的主键生成定义:系统生成自增长整数型数据作为主键
  8. *
  9. * @author Jeff Xu
  10. * @since 2015-12-09
  11. */
  12. @MappedSuperclass
  13. public class MysqlLongIdEntity extends IdEntity {
  14. protected Long id;
  15. @Id
  16. @GeneratedValue(strategy = GenerationType.IDENTITY)
  17. public Long getId() {
  18. return id;
  19. }
  20. public void setId(Long id) {
  21. this.id = id;
  22. }
  23. }