zoukankan      html  css  js  c++  java
  • 使用JAP(基类)父类注解

    -----------------基类-------------------------------

    /**
     * @className:com.jubangit.ebusiness.database.BasicEntityInterface
     * @description:TODO
     * @author:admin
     */
    package com.jubangit.smartbusiness.database;

    import java.util.UUID;

    import javax.persistence.Column;
    import javax.persistence.Id;
    import javax.persistence.MappedSuperclass;

    /**
     * 所有表都需要的字段,包含aguid,pguid,status,pxxh,remark
     *
     * @author admin
     */
    @MappedSuperclass
    public class BasicEntity {
     public static final String ID = "aguid";
     public static final String PID = "pguid";
     public static final String STATUS = "status";
     public static final String SERIAL_NUMBER = "pxxh";
     public static final String REMARK = "remark";
     public static final String TIME_UPDATE = "lastupdate";
     public static final int NORMAL_FLAG = 0;
     public static final int CANCEL_FLAG = 65536;
     @Id
     private UUID id;
     @Column(name = PID)
     private String pid;
     @Column(name = STATUS)
     protected int status;
     @Column(name = SERIAL_NUMBER)
     private long serialNum;
     @Column(name = REMARK)
     private String remark;
     @Column(name = TIME_UPDATE)
     protected String theLastOfUpdate;

     public UUID getId() {
      return id;
     }

     public void setId(UUID id) {
      this.id = id;
     }

     public String getPid() {
      return pid;
     }

     public void setPid(String pid) {
      this.pid = pid;
     }

     public int getStatus() {
      return status;
     }

     public void setStatus(int status) {
      this.status = status;
     }

     public long getSerialNum() {
      return serialNum;
     }

     public void setSerialNum(long serialNum) {
      this.serialNum = serialNum;
     }

     public String getRemark() {
      return remark;
     }

     public void setRemark(String remark) {
      this.remark = remark;
     }

     protected boolean isCanceled() {
      int flag = status & CANCEL_FLAG;
      return flag == CANCEL_FLAG;
     }

     /***
      * 返回状态对应的值
      *
      * @author:admin
      * @date:2013-8-13 下午3:00:41
      */
     public String getStatusLabel() {
      return "";
     }

     /**
      * 返回在通用查询列表中显示的名称
      *
      * @author:admin
      * @date:2013-8-13 下午3:25:20
      */
     public String getLabel() {
      return "";
     }

     /**
      * 最后更新的标识
      *
      * @param lastUpdate
      */
     public void setLastOfUpdate(String lastUpdate) {
      this.theLastOfUpdate = lastUpdate;
     }

     public String getLastOfUpdate() {
      return this.theLastOfUpdate;
     }
    }

    ------------------------子类-------------------------------------

    /**
     * @className:com.jubangit.ebusiness.database.entity.Areas
     * @description:TODO
     * @author:admin
     */
    package com.jubangit.smartbusiness.database.entity;

    import javax.persistence.Column;
    import javax.persistence.Entity;

    import com.jubangit.smartbusiness.database.BasicEntity;

    /**
     * 地区资料
     *
     * @author admin
     */
    @Entity(name=Areas.TABLE_NAME)
    public class Areas extends BasicEntity {
     public final static String TABLE_NAME = "pubarea";
     public final static String NAME = "aname";
     public final static String LEVEL = "lvl";
     @Column(name = NAME)
     private String name;
     @Column(name = LEVEL)
     private String level;

     public String getName() {
      return name;
     }

     public void setName(String name) {
      this.name = name;
     }

     public String getLevel() {
      return level;
     }

     public void setLevel(String level) {
      this.level = level;
     }

     public Areas() {
      super();
     }

     @Override
     public String getLabel() {
      return name;
     }

    }

  • 相关阅读:
    python3从尾到头打印链表
    替换空格
    二维数组中的查找
    堪比福尔摩斯的破案新科技!快来了解一下
    好莱坞首部全亚裔主演电影上映,华人终于谈恋爱了
    《呼啸山庄》:爱之深,恨之切,死相依
    《碟中谍 6:全面瓦解》口碑爆棚,登顶北美周末票房
    让重刑犯做瑜伽:新西兰人性化监狱的故事
    python面试笔试题汇总
    centos7 重置root 密码
  • 原文地址:https://www.cnblogs.com/qgc88/p/3435346.html
Copyright © 2011-2022 走看看