Hibernate支持Access方言源代码

开发 后端
本文提供了Hibernate支持Access方言的源代码。

以下提供的源代码,可以让Hibernate支持Access方言:

  1. package com.hxtt.support.hibernate;  
  2.  
  3. import org.hibernate.Hibernate;  
  4. import org.hibernate.dialect.Dialect;  
  5. import org.hibernate.dialect.function.VarArgsSQLFunction;  
  6. import org.hibernate.cfg.Environment;  
  7. import org.hibernate.dialect.function.NoArgSQLFunction;  
  8. import org.hibernate.dialect.function.StandardSQLFunction;  
  9.  
  10. public class HxttDialect extends Dialect {  
  11.  
  12.      static final String DEFAULT_BATCH_SIZE = "15";  
  13. static final String NO_BATCH = "0";  
  14.  
  15.  
  16.      public HxttDialect() {  
  17.          super();  
  18.      //Mathematical Functions  
  19.      registerFunction("abs"new StandardSQLFunction("abs") );  
  20.      registerFunction("ceiling"new StandardSQLFunction("ceiling", Hibernate.INTEGER) );  
  21.      registerFunction("ceil"new StandardSQLFunction("ceil", Hibernate.INTEGER) );   registerFunction("sign"new StandardSQLFunction("sign", Hibernate.INTEGER) );  
  22.      registerFunction("degrees"new StandardSQLFunction("degrees", Hibernate.DOUBLE) );  
  23.      registerFunction("exp"new StandardSQLFunction("exp", Hibernate.DOUBLE) );  
  24.      registerFunction("floor"new StandardSQLFunction("floor", Hibernate.INTEGER) );  
  25.      registerFunction("int"new StandardSQLFunction("int", Hibernate.INTEGER) );  
  26.      registerFunction("log"new StandardSQLFunction("log", Hibernate.DOUBLE) );  
  27.      registerFunction("log10"new StandardSQLFunction("log10", Hibernate.DOUBLE) );  
  28.      registerFunction("log2"new StandardSQLFunction("log2", Hibernate.DOUBLE) );  
  29.      registerFunction("ln"new StandardSQLFunction("ln", Hibernate.DOUBLE) );  
  30.      registerFunction("mod"new StandardSQLFunction("mod", Hibernate.INTEGER) );  
  31.      registerFunction("pi"new NoArgSQLFunction("pi", Hibernate.DOUBLE) );  
  32.      registerFunction("pow"new StandardSQLFunction("pow", Hibernate.DOUBLE) );  
  33.      registerFunction("power"new StandardSQLFunction("power", Hibernate.DOUBLE) );  
  34.      registerFunction("padians"new StandardSQLFunction("padians", Hibernate.DOUBLE) );  
  35.      registerFunction("radians"new StandardSQLFunction("radians", Hibernate.DOUBLE) );  
  36.      registerFunction("rand"new NoArgSQLFunction("rand", Hibernate.DOUBLE) );  
  37.      registerFunction("round"new StandardSQLFunction("round", Hibernate.INTEGER) );  
  38.      registerFunction("sign"new StandardSQLFunction("sign", Hibernate.INTEGER) );  
  39.      registerFunction("sqrt"new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );  
  40.      registerFunction("trunc"new StandardSQLFunction("trunc", Hibernate.DOUBLE) );  
  41.      registerFunction("truncate"new StandardSQLFunction("truncate", Hibernate.DOUBLE) );  
  42.      //Trigonometric Functions  
  43.      registerFunction("acos"new StandardSQLFunction("acos", Hibernate.DOUBLE) );  
  44.      registerFunction("asin"new StandardSQLFunction("asin", Hibernate.DOUBLE) );  
  45.      registerFunction("atan"new StandardSQLFunction("atan", Hibernate.DOUBLE) );  
  46.      registerFunction("atan2"new StandardSQLFunction("atan2", Hibernate.DOUBLE) );  
  47.      registerFunction("cos"new StandardSQLFunction("cos", Hibernate.DOUBLE) );  
  48.      registerFunction("cot"new StandardSQLFunction("cot", Hibernate.DOUBLE) );  
  49.      registerFunction("crc32"new StandardSQLFunction("crc32", Hibernate.LONG) );  
  50.      registerFunction("sin"new StandardSQLFunction("sin", Hibernate.DOUBLE) );  
  51.      registerFunction("tan"new StandardSQLFunction("tan", Hibernate.DOUBLE) );  
  52.  
  53. //String Functions  
  54.      registerFunction("alltrim"new StandardSQLFunction("alltrim") );  
  55.      registerFunction("asc"new StandardSQLFunction("asc", Hibernate.INTEGER) );  
  56.      registerFunction("ascii"new StandardSQLFunction("ascii", Hibernate.INTEGER) );  
  57.      registerFunction("at"new StandardSQLFunction("at", Hibernate.INTEGER) );  
  58.      registerFunction("bin"new StandardSQLFunction("bin", Hibernate.STRING) );  
  59.      registerFunction("bit_length"new StandardSQLFunction("bit_length", Hibernate.LONG) );  
  60.      registerFunction("char_length"new StandardSQLFunction("char_length", Hibernate.LONG) );  
  61.      registerFunction("character_length"new StandardSQLFunction("character_length", Hibernate.LONG) );  
  62.      registerFunction("char"new StandardSQLFunction("char", Hibernate.STRING) );  
  63.      registerFunction("chr"new StandardSQLFunction("char", Hibernate.STRING) );  
  64.      registerFunction("chrtran"new StandardSQLFunction("chrtran", Hibernate.STRING) );  
  65.      registerFunction( "concat"new VarArgsSQLFunction(Hibernate.STRING, """||""") );  
  66.      registerFunction( "concat_ws"new VarArgsSQLFunction(Hibernate.STRING, """||""") );  
  67.      registerFunction( "conv"new StandardSQLFunction("conv", Hibernate.STRING) );  
  68.      registerFunction( "difference"new StandardSQLFunction("difference", Hibernate.STRING) );  
  69.      registerFunction("hex"new StandardSQLFunction("hex", Hibernate.STRING) );  
  70.      registerFunction("initcap"new StandardSQLFunction("initcap") );  
  71. // registerFunction("insert", new StandardSQLFunction("insert") );  
  72.      registerFunction("instr"new StandardSQLFunction("instr", Hibernate.INTEGER) );  
  73.      registerFunction("lcase"new StandardSQLFunction("lcase") );  
  74.      registerFunction("left"new StandardSQLFunction("left", Hibernate.INTEGER) );  
  75.      registerFunction("len"new StandardSQLFunction("len", Hibernate.LONG) );  
  76.      registerFunction("length"new StandardSQLFunction("length", Hibernate.LONG) );  
  77.      registerFunction("locate"new StandardSQLFunction("locate", Hibernate.LONG) );  
  78.      registerFunction("lower"new StandardSQLFunction("lower") );  
  79.      registerFunction("lpad"new StandardSQLFunction("lpad", Hibernate.STRING) );  
  80.      registerFunction("ltrim"new StandardSQLFunction("ltrim") );  
  81.      registerFunction("mid"new StandardSQLFunction("mid", Hibernate.STRING) );  
  82.      registerFunction("oct"new StandardSQLFunction("oct", Hibernate.STRING) );  
  83.      registerFunction("octet_length"new StandardSQLFunction("octet_length", Hibernate.LONG) );  
  84.      registerFunction("padc"new StandardSQLFunction("padc", Hibernate.STRING) );  
  85.      registerFunction("padl"new StandardSQLFunction("padl", Hibernate.STRING) );  
  86.      registerFunction("padr"new StandardSQLFunction("padr", Hibernate.STRING) );  
  87.      registerFunction("position"new StandardSQLFunction("position", Hibernate.INTEGER) );  
  88.      registerFunction("proper"new StandardSQLFunction("proper") ) ;  
  89.      registerFunction("repeat"new StandardSQLFunction("repeat", Hibernate.STRING) );  
  90.      registerFunction("replicate"new StandardSQLFunction("replicate", Hibernate.STRING) );  
  91.      registerFunction("replace"new StandardSQLFunction("replace", Hibernate.STRING) );  
  92.      registerFunction("right"new StandardSQLFunction("right", Hibernate.INTEGER) );  
  93.      registerFunction("rpad"new StandardSQLFunction("rpad", Hibernate.STRING) );  
  94.      registerFunction("rtrim"new StandardSQLFunction("rtrim") );  
  95.      registerFunction("soundex"new StandardSQLFunction("soundex") );  
  96.      registerFunction("space"new StandardSQLFunction("space", Hibernate.STRING) );  
  97.      registerFunction( "strcat"new VarArgsSQLFunction(Hibernate.STRING, """||""") );  
  98.      registerFunction("strcmp"new StandardSQLFunction("strcmp", Hibernate.INTEGER) );  
  99.      registerFunction("strconv"new StandardSQLFunction("strconv", Hibernate.STRING) );  
  100.      registerFunction("strtran"new StandardSQLFunction("strtran", Hibernate.STRING) );  
  101.      registerFunction("stuff"new StandardSQLFunction("stuff", Hibernate.STRING) );  
  102.      registerFunction("substr"new StandardSQLFunction("stuff", Hibernate.STRING) );  
  103.      registerFunction("substring"new StandardSQLFunction("substring", Hibernate.STRING) );  
  104.      registerFunction("translate"new StandardSQLFunction("translate", Hibernate.STRING) );  
  105.      registerFunction("trim"new StandardSQLFunction("trim") );  
  106.      registerFunction("ucase"new StandardSQLFunction("ucase") );  
  107.      registerFunction("upper"new StandardSQLFunction("upper") );  
  108.      registerFunction("charmirr"new StandardSQLFunction("charmirr") );  
  109.      registerFunction("reverse"new StandardSQLFunction("reverse") );  
  110.  
  111.      //Date/Time Functions  
  112.      registerFunction("addtime",new StandardSQLFunction("addtime",Hibernate.TIMESTAMP));  
  113.      registerFunction("cdow",new StandardSQLFunction("cdow",Hibernate.STRING));  
  114.      registerFunction("cmonth",new StandardSQLFunction("cmonth",Hibernate.STRING));  
  115.      registerFunction("curdate"new NoArgSQLFunction("curdate", Hibernate.DATE) );  
  116.      registerFunction("curtime"new NoArgSQLFunction("curtime", Hibernate.TIME) );  
  117.      registerFunction("date"new StandardSQLFunction("date", Hibernate.DATE) );  
  118.      registerFunction("datediff"new StandardSQLFunction("datediff", Hibernate.INTEGER) );  
  119.      registerFunction("datetime",new   NoArgSQLFunction("datetime",Hibernate.TIMESTAMP));  
  120.      registerFunction("date_add",new   StandardSQLFunction("date_add",Hibernate.DATE));  
  121.      registerFunction("date_sub",new   StandardSQLFunction("date_sub",Hibernate.DATE));  
  122.      registerFunction("adddate",new   StandardSQLFunction("adddate",Hibernate.DATE));  
  123.      registerFunction("subdate",new   StandardSQLFunction("subdate",Hibernate.DATE));  
  124.      registerFunction("day"new StandardSQLFunction("day", Hibernate.INTEGER) );  
  125.      registerFunction("dayofmonth"new StandardSQLFunction("dayofmonth", Hibernate.INTEGER) );  
  126.      registerFunction("dayname"new StandardSQLFunction("dayname", Hibernate.STRING) );  
  127.      registerFunction("dayofweek"new StandardSQLFunction("dayofweek", Hibernate.INTEGER) );  
  128.      registerFunction("dayofyear"new StandardSQLFunction("dayofyear", Hibernate.INTEGER) );  
  129.      registerFunction("extract",new   StandardSQLFunction("extract",Hibernate.INTEGER));  
  130.      registerFunction("dow",new StandardSQLFunction("dow",Hibernate.STRING));  
  131.      registerFunction("from_days"new StandardSQLFunction("from_days", Hibernate.DATE) );  
  132.      registerFunction("gomonth"new StandardSQLFunction("gomonth", Hibernate.DATE) );  
  133.      registerFunction("hour"new StandardSQLFunction("hour", Hibernate.INTEGER) );  
  134.      registerFunction("last_day"new StandardSQLFunction("last_day", Hibernate.DATE) );  
  135.      registerFunction("minute",new   StandardSQLFunction("minute",Hibernate.INTEGER));  
  136.      registerFunction("millisecond",new   StandardSQLFunction("millisecond",Hibernate.INTEGER));  
  137.      registerFunction("microsecond",new   StandardSQLFunction("microsecond",Hibernate.INTEGER));  
  138.      registerFunction("month",new   StandardSQLFunction("month",Hibernate.INTEGER));  
  139.      registerFunction("monthname",new StandardSQLFunction("monthname",Hibernate.STRING));  
  140.      registerFunction("now"new NoArgSQLFunction("now", Hibernate.TIMESTAMP) );  
  141.      registerFunction("quarter"new StandardSQLFunction("quarter", Hibernate.INTEGER) );  
  142.      registerFunction("second"new StandardSQLFunction("second", Hibernate.INTEGER) );  
  143.      registerFunction("sub_time"new NoArgSQLFunction("sub_time", Hibernate.TIMESTAMP) );  
  144.      registerFunction("sysdate"new NoArgSQLFunction("sysdate", Hibernate.TIMESTAMP) );  
  145.      registerFunction("time"new StandardSQLFunction("time", Hibernate.TIME) );  
  146.      registerFunction("timediff"new StandardSQLFunction("timediff", Hibernate.TIME) );  
  147.      registerFunction("timestamp"new StandardSQLFunction("timestamp", Hibernate.TIMESTAMP) );  
  148.      registerFunction("timestampadd"new StandardSQLFunction("timestampadd", Hibernate.TIMESTAMP) );  
  149.      registerFunction("timestampdiff"new StandardSQLFunction("timestampdiff", Hibernate.INTEGER) );  
  150.      registerFunction("to_days"new StandardSQLFunction("to_days", Hibernate.INTEGER) );  
  151.      registerFunction("week"new StandardSQLFunction("week", Hibernate.INTEGER) );  
  152.      registerFunction("weekofyear"new StandardSQLFunction("weekofyear", Hibernate.INTEGER) );  
  153.      registerFunction("year"new StandardSQLFunction("year", Hibernate.INTEGER) );  
  154. //boolean functions  
  155.     registerFunction("empty"new StandardSQLFunction("empty", Hibernate.BOOLEAN) );  
  156.     registerFunction("isblank"new StandardSQLFunction("isblank", Hibernate.BOOLEAN) );  
  157.     registerFunction("isalpha"new StandardSQLFunction("isalpha", Hibernate.BOOLEAN) );  
  158.     registerFunction("isdigit"new StandardSQLFunction("isdigit", Hibernate.BOOLEAN) );  
  159.     registerFunction("isnull"new StandardSQLFunction("isnull", Hibernate.BOOLEAN) );  
  160. //Conversion Functions  
  161.     registerFunction("cbool"new StandardSQLFunction("cbool", Hibernate.BOOLEAN) );  
  162.     registerFunction("cbyte"new StandardSQLFunction("cbyte", Hibernate.BYTE) );  
  163.     registerFunction("cdate"new StandardSQLFunction("cdate", Hibernate.DATE) );  
  164.     registerFunction("cdbl"new StandardSQLFunction("cdbl", Hibernate.DOUBLE) );  
  165.     registerFunction("cint"new StandardSQLFunction("cint", Hibernate.INTEGER) );  
  166.     registerFunction("clng"new StandardSQLFunction("clng", Hibernate.LONG) );  
  167.     registerFunction("csng"new StandardSQLFunction("csng", Hibernate.FLOAT) );  
  168.     registerFunction("cstr"new StandardSQLFunction("cstr", Hibernate.STRING) );  
  169.     registerFunction("ctod"new StandardSQLFunction("ctod", Hibernate.DATE) );  
  170.     registerFunction("ctot"new StandardSQLFunction("ctot", Hibernate.TIMESTAMP) );  
  171.     registerFunction("dtoc"new StandardSQLFunction("dtoc", Hibernate.STRING) );  
  172.     registerFunction("dtot"new StandardSQLFunction("dtot", Hibernate.TIMESTAMP) );  
  173.     registerFunction("ttoc"new StandardSQLFunction("ttoc", Hibernate.STRING) );  
  174.     registerFunction("ttod"new StandardSQLFunction("ttod", Hibernate.DATE) );  
  175. //Security Functions  
  176.      registerFunction("compress"new StandardSQLFunction("compress", Hibernate.STRING) );  
  177.      registerFunction("uncompress"new StandardSQLFunction("uncompress", Hibernate.STRING) );  
  178.      registerFunction("encrypt"new StandardSQLFunction("encrypt", Hibernate.STRING) );  
  179.      registerFunction("decrypt"new StandardSQLFunction("decrypt", Hibernate.STRING) );  
  180.      registerFunction("encode"new StandardSQLFunction("encode", Hibernate.STRING) );  
  181.      registerFunction("decode"new StandardSQLFunction("decode", Hibernate.STRING) );  
  182.      registerFunction("md5"new StandardSQLFunction("md5", Hibernate.STRING) );  
  183.      registerFunction("crypt3"new StandardSQLFunction("crypt3", Hibernate.STRING) );  
  184. //System Functions  
  185.      registerFunction( "database"new NoArgSQLFunction("database", Hibernate.STRING, false) );  
  186.      registerFunction( "user"new NoArgSQLFunction("user", Hibernate.STRING, false) );  
  187.      registerFunction( "deleted"new NoArgSQLFunction("deleted", Hibernate.BOOLEAN, false) );  
  188.      registerFunction( "reccount"new NoArgSQLFunction("reccount", Hibernate.LONG, false) );  
  189.      registerFunction( "recno"new NoArgSQLFunction("recno", Hibernate.LONG, false) );  
  190.      registerFunction( "rowlocked"new NoArgSQLFunction("rowlocked", Hibernate.BOOLEAN, false) );  
  191. //Miscellaneous Functions  
  192.      registerFunction( "nvl"new StandardSQLFunction("nvl") );  
  193.      registerFunction( "ifnull"new StandardSQLFunction("ifnull") );  
  194.  
  195.  
  196.      getDefaultProperties().setProperty(Environment.MAX_FETCH_DEPTH, "2");  
  197.      getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE);  
  198.      }  
  199. }  
  200.  
  201.  
  202. ////////////////////////////////////////////////////////////////////////////////  
  203.  
  204.  
  205. package com.hxtt.support.hibernate;  
  206.  
  207. import java.sql.Types;  
  208.  
  209.  
  210. /**  
  211. * An SQL dialect for HXTT Access.  
  212. * @author daiwei  
  213. */ 
  214. public class HxttAccessDialect   extends HxttDialect {  
  215.  
  216.      public HxttAccessDialect() {  
  217.          super();  
  218.          //complete map  
  219.          //registerColumnType( Types.BIT, "bit" );  
  220.          //registerColumnType( Types.CHAR, "varchar(1)" );        // HXTT Access DON'T SUPPORT CHAR,and there is no varchar(1) column type,so there is no CHAR  
  221.          registerColumnType(Types.CHAR, "varchar($l)");  
  222.          registerColumnType(Types.VARCHAR, 255"varchar($l)");  
  223.          registerColumnType(Types.LONGVARCHAR, "longvarchar");  
  224.          registerColumnType(Types.NUMERIC, "numeric");  
  225.          registerColumnType(Types.NUMERIC, "numeric($p,$s)");  
  226.          registerColumnType(Types.BOOLEAN, "boolean");  
  227.          registerColumnType( Types.BIGINT, "NUMERIC(19,0)" );   // MS Access DON'T SUPPORT BIGINT  
  228.          //registerColumnType( Types.TINYINT, "number(3,0)" );    // MS Access DON'T SUPPORT TINYINT  
  229.          //registerColumnType(Types.TINYINT, "tinyint"); //HXTT Access' tinyint is from 0 to 255  
  230.          registerColumnType(Types.TINYINT, "smallint"); //HXTT Access' tinyint is from 0 to 255  
  231.          registerColumnType(Types.SMALLINT, "smallint");  
  232.          registerColumnType(Types.INTEGER, "integer");  
  233.          registerColumnType(Types.REAL, "real");  
  234.          //registerColumnType( Types.FLOAT, "float" ); // HXTT Access DON'T SUPPORT FLOAT ,it will be a double type  
  235.          registerColumnType(Types.DOUBLE, "double");  
  236.          //registerColumnType( Types.BINARY, 6784, "binary" );  
  237.          registerColumnType(Types.VARBINARY, 510"varbinary");  
  238.          //registerColumnType( Types.LONGVARBINARY, "longvarbinary");  
  239.  
  240.          //registerColumnType( Types.DATE, "date" );  
  241.          // registerColumnType( Types.TIME, "time" );    //   HXTT Access DON'T SUPPORT TIME  
  242.          registerColumnType(Types.TIMESTAMP, "timestamp");  
  243.          //registerColumnType( Types.BLOB, "blob" ); // BLOB COLUMN WILL CHANGE TO   JAVA_OBJECT TYPE COLUMN  
  244.          //registerColumnType( Types.CLOB, "clob" ); // CLOB COLUMN WILL CHANGE TO   LONGVARCHAR TYPE COLUMN  
  245.          registerColumnType(Types.OTHER, "currency");  
  246.          //registerColumnType( Types.OTHER, "graphics" );  
  247.          registerColumnType(Types.OTHER, "ole");  
  248.          registerColumnType( Types.JAVA_OBJECT, "java_object" );  
  249.  
  250.      }  
  251.  
  252.      //ALTER table TBNAME ADD COLUMN FIELDNAME FIELDTYPE  
  253.      public String getAddColumnString() {  
  254.          return "add column";  
  255.      }  
  256.  
  257.     ///处理到此函数  
  258.      public boolean bindLimitParametersInReverseOrder() {  
  259.          return true;  
  260.      }  
  261.  
  262.  
  263.      public String getCreateSequenceString(String sequenceName) {  
  264.          // create sequence if not exists userID start WITH 100 increment by 2 maxvalue 2000 cache 5 cycle;  
  265.          return "create sequence " + sequenceName + " start with 1"//  
  266.      }  
  267.  
  268.      public String getCurrentTimestampSelectString() {  
  269.          return "?now()";  
  270.      }  
  271.  
  272.  
  273.      public String getDropForeignKeyString() {  
  274.         throw new UnsupportedOperationException( "No drop foreign key syntax supported by HxttAccessDialect" );  
  275.      }  
  276.  
  277.      public String getDropSequenceString(String sequenceName) {  
  278.              //drop sequence if exists userID;  
  279.              return "drop sequence " + sequenceName;  
  280.      }  
  281.  
  282.      public String getLimitString(String sql, boolean hasOffset) {  
  283. /*         return new StringBuffer(sql.length() + 20)  
  284.              .append(sql)  
  285.              .append(hasOffset ? " limit ?, ?" : " limit ?")  
  286.              .toString();*/ 
  287.  
  288.          sql = sql.trim();  
  289.          boolean isForUpdate = false;  
  290.          if ( sql.toLowerCase().endsWith(" for update") ) {  
  291.              sql = sql.substring( 0, sql.length()-11 );  
  292.              isForUpdate = true;  
  293.          }  
  294.  
  295.          StringBuffer pagingSelect = new StringBuffer( sql.length()+100 );  
  296.          if (hasOffset) {  
  297.              pagingSelect.append("select * from ( select row_.*, RECNO() rownum_ from ( ");  
  298.          }  
  299.          else {  
  300.              pagingSelect.append("select * from ( ");  
  301.          }  
  302.          pagingSelect.append(sql);  
  303.          if (hasOffset) {  
  304.              pagingSelect.append(" ) row_ where RECNO() < = ?) where rownum_ > ?");  
  305.          }  
  306.          else {  
  307.              pagingSelect.append(" ) where RECNO() < = ?");  
  308.          }  
  309.  
  310.          if (isForUpdate) pagingSelect.append(" for update");  
  311.  
  312.          return pagingSelect.toString();  
  313.      }  
  314.  
  315.  
  316.      ////????  
  317.      /**  
  318.       * A query used to find all sequences  
  319.       *  
  320.       * @see org.hibernate.tool.hbm2ddl.SchemaUpdate  
  321.       */ 
  322.      public String getQuerySequencesString() {  
  323.          return null;  
  324.      }  
  325.  
  326.      //?NEXTVAL('SEQUENCENAME')  
  327.      public String getSequenceNextValString(String sequenceName) {  
  328.          return "?" + getSelectSequenceNextValString( sequenceName ) ;  
  329.      }  
  330.  
  331.      public String getSelectSequenceNextValString(String sequenceName) {  
  332.          return   "nextval('" + sequenceName+"')";  
  333.      }  
  334.  
  335.  
  336.      ////????  
  337.      public boolean isCurrentTimestampSelectStringCallable() {  
  338.          return false;  
  339.      }  
  340.  
  341.  
  342.      public boolean qualifyIndexName() {  
  343.          return false;  
  344.      }  
  345.  
  346.  
  347.      public boolean supportsCascadeDelete() {  
  348.          return true;//false;  
  349.      }  
  350.  
  351.  
  352.      public boolean supportsCurrentTimestampSelection() {  
  353.          return true;  
  354.      }  
  355.  
  356.  
  357.      public boolean supportsIfExistsBeforeTableName() {  
  358.          return true;  
  359.      }  
  360.  
  361.  
  362.      public boolean supportsLimit() {  
  363.          return true;  
  364.      }  
  365.  
  366.  
  367.      public boolean supportsUnionAll() {  
  368.          return true;  
  369.      }  
  370.  
  371.      public boolean supportsSequences() {  
  372.             return true;  
  373.      }  
  374.  
  375.  
  376. /*     public boolean supportsIdentityColumns() {  
  377.          return true;  
  378.      }  
  379.  
  380.      public String getIdentitySelectString() {  
  381.          return "select last_insert_id()";  
  382.      }  
  383.  
  384.      public String getIdentityColumnString() {  
  385.          return "not null auto_increment"; //starts with 1, implicitly  
  386.      }*/ 
  387.  
  388. }  
  389.  

【编辑推荐】

  1. 强人Hibernate文档笔记(上)
  2. 强人Hibernate文档笔记(中)
  3. Hibernate不同数据库的连接及SQL方言
  4. hibernate 数据库连接池
  5. hibernate 重复导入问题处理

 

责任编辑:book05 来源: 百度博客
相关推荐

2009-06-24 07:59:49

Hibernate方言

2009-09-22 13:35:04

Hibernate A

2009-06-23 10:45:18

Hibernate支持

2009-06-24 07:58:52

Hibernate多数

2009-06-24 07:55:36

Hibernate不同SQL方言

2009-06-26 16:12:59

2018-12-13 12:50:03

Android 源码Fuchsia

2023-08-07 09:51:58

2009-09-23 10:28:49

使用Hibernate

2009-07-03 09:29:24

KeelKit

2021-07-17 15:29:18

AMDFSR源代码开源

2020-11-13 13:05:27

Java开发代码

2011-02-23 14:54:58

FileZilla

2023-03-27 18:22:05

2011-02-23 14:46:21

FileZilla

2011-02-23 14:16:43

FileZilla

2009-04-03 08:28:39

2020-11-14 11:20:56

渗透测试Cobalt Stri源代码

2011-02-23 14:39:27

FileZilla

2013-04-27 09:26:40

Github
点赞
收藏

51CTO技术栈公众号