package com.tykj.model.create_util;

import com.tykj.model.entity.vo.TableVO;

/**
 * @author huangjiafu
 * @version V1.0
 * @data 2021/7/15 10:58
 **/
public class OscarCreateUtil extends BaseCreateUtil {
    @Override
    public String createTable(TableVO tableVO) {
        return super.createTable(tableVO);
    }

    @Override
    String addGenerator(TableVO tableVO) {

        return  " <id name=\"ID\" type=\"java.lang.Integer\" length=\"11\" unsaved-value=\"null\"  >\n" +
                "  <generator  class=\"com.tykj.base.entity.XMQGenerator\"  >\n" +
                "<param name=\"sequence\">SEQUENCE_" + tableVO.getModelName().toLowerCase().toUpperCase() + "</param>" +
                "</generator>" +
                "        </id>\n";
    }

    @Override
    String addDefaultTime(TableVO tableVO) {
         return  "  <property name = \"CREATE_TIME\" type =\"java.util.Date\"  generated=\"always\"  >    \n" +
                "            <column name = \"CREATE_TIME\"  default = \"CURRENT_TIMESTAMP\" />    \n" +
                "        </property>  \n" +
                "       <property name = \"UPDATE_TIME\" type =\"java.util.Date\"  >    \n" +
                "            <column name = \"UPDATE_TIME\"  default = \"CURRENT_TIMESTAMP\" />    \n" +
                "        </property>  ";
    }

}
