当前位置: 首页>>代码示例>>Java>>正文


Java VarArgsSQLFunction类代码示例

本文整理汇总了Java中org.hibernate.dialect.function.VarArgsSQLFunction的典型用法代码示例。如果您正苦于以下问题:Java VarArgsSQLFunction类的具体用法?Java VarArgsSQLFunction怎么用?Java VarArgsSQLFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VarArgsSQLFunction类属于org.hibernate.dialect.function包,在下文中一共展示了VarArgsSQLFunction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: InterbaseDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
/**
 * Constructs a InterbaseDialect
 */
public InterbaseDialect() {
	super();
	registerColumnType( Types.BIT, "smallint" );
	registerColumnType( Types.BIGINT, "numeric(18,0)" );
	registerColumnType( Types.SMALLINT, "smallint" );
	registerColumnType( Types.TINYINT, "smallint" );
	registerColumnType( Types.INTEGER, "integer" );
	registerColumnType( Types.CHAR, "char(1)" );
	registerColumnType( Types.VARCHAR, "varchar($l)" );
	registerColumnType( Types.FLOAT, "float" );
	registerColumnType( Types.DOUBLE, "double precision" );
	registerColumnType( Types.DATE, "date" );
	registerColumnType( Types.TIME, "time" );
	registerColumnType( Types.TIMESTAMP, "timestamp" );
	registerColumnType( Types.VARBINARY, "blob" );
	registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
	registerColumnType( Types.BLOB, "blob" );
	registerColumnType( Types.CLOB, "blob sub_type 1" );
	registerColumnType( Types.BOOLEAN, "smallint" );
	
	registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(","||",")" ) );
	registerFunction( "current_date", new NoArgSQLFunction( "current_date", StandardBasicTypes.DATE, false ) );

	getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:InterbaseDialect.java

示例2: InterbaseDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public InterbaseDialect() {
	super();
	registerColumnType( Types.BIT, "smallint" );
	registerColumnType( Types.BIGINT, "numeric(18,0)" );
	registerColumnType( Types.SMALLINT, "smallint" );
	registerColumnType( Types.TINYINT, "smallint" );
	registerColumnType( Types.INTEGER, "integer" );
	registerColumnType( Types.CHAR, "char(1)" );
	registerColumnType( Types.VARCHAR, "varchar($l)" );
	registerColumnType( Types.FLOAT, "float" );
	registerColumnType( Types.DOUBLE, "double precision" );
	registerColumnType( Types.DATE, "date" );
	registerColumnType( Types.TIME, "time" );
	registerColumnType( Types.TIMESTAMP, "timestamp" );
	registerColumnType( Types.VARBINARY, "blob" );
	registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
	registerColumnType( Types.BLOB, "blob" );
	registerColumnType( Types.CLOB, "blob sub_type 1" );
	
	registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(","||",")" ) );

	getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:24,代码来源:InterbaseDialect.java

示例3: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {
    registerColumnType(Types.BIT, "integer");
    registerColumnType(Types.TINYINT, "tinyint");
    registerColumnType(Types.SMALLINT, "smallint");
    registerColumnType(Types.INTEGER, "integer");
    registerColumnType(Types.BIGINT, "bigint");
    registerColumnType(Types.FLOAT, "float");
    registerColumnType(Types.REAL, "real");
    registerColumnType(Types.DOUBLE, "double");
    registerColumnType(Types.NUMERIC, "numeric");
    registerColumnType(Types.DECIMAL, "decimal");
    registerColumnType(Types.CHAR, "char");
    registerColumnType(Types.VARCHAR, "varchar");
    registerColumnType(Types.LONGVARCHAR, "longvarchar");
    registerColumnType(Types.DATE, "date");
    registerColumnType(Types.TIME, "time");
    registerColumnType(Types.TIMESTAMP, "timestamp");
    registerColumnType(Types.BINARY, "blob");
    registerColumnType(Types.VARBINARY, "blob");
    registerColumnType(Types.LONGVARBINARY, "blob");
    // registerColumnType(Types.NULL, "null");
    registerColumnType(Types.BLOB, "blob");
    registerColumnType(Types.CLOB, "clob");
    registerColumnType(Types.BOOLEAN, "integer");

    registerFunction("concat", new VarArgsSQLFunction(StringType.INSTANCE, "", "||", ""));
    registerFunction("mod", new SQLFunctionTemplate(StringType.INSTANCE, "?1 % ?2"));
    registerFunction("substr", new StandardSQLFunction("substr", StringType.INSTANCE));
    registerFunction("substring", new StandardSQLFunction("substr", StringType.INSTANCE));
}
 
开发者ID:amvnetworks,项目名称:amv-access-api-poc,代码行数:31,代码来源:SQLiteDialect.java

示例4: SqliteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SqliteDialect() {
    super();
    registerColumnType(Types.BIT, "integer");
    registerColumnType(Types.TINYINT, "tinyint");
    registerColumnType(Types.SMALLINT, "smallint");
    registerColumnType(Types.INTEGER, "integer");
    registerColumnType(Types.BIGINT, "bigint");
    registerColumnType(Types.FLOAT, "float");
    registerColumnType(Types.REAL, "real");
    registerColumnType(Types.DOUBLE, "double");
    registerColumnType(Types.NUMERIC, "numeric");
    registerColumnType(Types.DECIMAL, "decimal");
    registerColumnType(Types.CHAR, "char");
    registerColumnType(Types.VARCHAR, "varchar");
    registerColumnType(Types.LONGVARCHAR, "longvarchar");
    registerColumnType(Types.DATE, "date");
    registerColumnType(Types.TIME, "time");
    registerColumnType(Types.TIMESTAMP, "timestamp");
    registerColumnType(Types.BINARY, "blob");
    registerColumnType(Types.VARBINARY, "blob");
    registerColumnType(Types.LONGVARBINARY, "blob");
    registerColumnType(Types.BLOB, "blob");
    registerColumnType(Types.CLOB, "clob");
    registerColumnType(Types.BOOLEAN, "integer");
    registerFunction("concat", new VarArgsSQLFunction(StringType.INSTANCE, "", "||", ""));
    registerFunction("mod", new SQLFunctionTemplate(IntegerType.INSTANCE, "?1 % ?2"));
    registerFunction("substr", new StandardSQLFunction("substr", StringType.INSTANCE));
    registerFunction("substring", new StandardSQLFunction("substr", StringType.INSTANCE));
}
 
开发者ID:Martion2017,项目名称:ApplicationDetection,代码行数:30,代码来源:SqliteDialect.java

示例5: Ingres9Dialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
/**
 * Constructs a Ingres9Dialect
 */
public Ingres9Dialect() {
	super();
	registerDateTimeFunctions();
	registerDateTimeColumnTypes();
	registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(", "||", ")" ) );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:Ingres9Dialect.java

示例6: InformixDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
/**
 * Creates new <code>InformixDialect</code> instance. Sets up the JDBC /
 * Informix type mappings.
 */
public InformixDialect() {
	super();

	registerColumnType( Types.BIGINT, "int8" );
	registerColumnType( Types.BINARY, "byte" );
	// Informix doesn't have a bit type
	registerColumnType( Types.BIT, "smallint" );
	registerColumnType( Types.CHAR, "char($l)" );
	registerColumnType( Types.DATE, "date" );
	registerColumnType( Types.DECIMAL, "decimal" );
	registerColumnType( Types.DOUBLE, "float" );
	registerColumnType( Types.FLOAT, "smallfloat" );
	registerColumnType( Types.INTEGER, "integer" );
	// or BYTE
	registerColumnType( Types.LONGVARBINARY, "blob" );
	// or TEXT?
	registerColumnType( Types.LONGVARCHAR, "clob" );
	// or MONEY
	registerColumnType( Types.NUMERIC, "decimal" );
	registerColumnType( Types.REAL, "smallfloat" );
	registerColumnType( Types.SMALLINT, "smallint" );
	registerColumnType( Types.TIMESTAMP, "datetime year to fraction(5)" );
	registerColumnType( Types.TIME, "datetime hour to second" );
	registerColumnType( Types.TINYINT, "smallint" );
	registerColumnType( Types.VARBINARY, "byte" );
	registerColumnType( Types.VARCHAR, "varchar($l)" );
	registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
	registerColumnType( Types.VARCHAR, 32739, "lvarchar($l)" );

	registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(", "||", ")" ) );
	
	uniqueDelegate = new InformixUniqueDelegate( this );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:38,代码来源:InformixDialect.java

示例7: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect()
{
	super();
	registerColumnType(Types.BIT, "integer");
	registerColumnType(Types.TINYINT, "tinyint");
	registerColumnType(Types.SMALLINT, "smallint");
	registerColumnType(Types.INTEGER, "integer");
	registerColumnType(Types.BIGINT, "bigint");
	registerColumnType(Types.FLOAT, "float");
	registerColumnType(Types.REAL, "real");
	registerColumnType(Types.DOUBLE, "double");
	registerColumnType(Types.NUMERIC, "numeric");
	registerColumnType(Types.DECIMAL, "decimal");
	registerColumnType(Types.CHAR, "char");
	registerColumnType(Types.VARCHAR, "varchar");
	registerColumnType(Types.LONGVARCHAR, "longvarchar");
	registerColumnType(Types.DATE, "date");
	registerColumnType(Types.TIME, "time");
	registerColumnType(Types.TIMESTAMP, "timestamp");
	registerColumnType(Types.BINARY, "blob");
	registerColumnType(Types.VARBINARY, "blob");
	registerColumnType(Types.LONGVARBINARY, "blob");
	// registerColumnType(Types.NULL, "null");
	registerColumnType(Types.BLOB, "blob");
	registerColumnType(Types.CLOB, "clob");
	registerColumnType(Types.BOOLEAN, "integer");
	registerFunction("concat", new VarArgsSQLFunction(new StringType(), "", "||", ""));
	registerFunction("mod", new SQLFunctionTemplate(new IntegerType(), "?1 % ?2"));
	registerFunction("substr", new StandardSQLFunction("substr", new StringType()));
	registerFunction("substring", new StandardSQLFunction("substr", new StringType()));
}
 
开发者ID:skeychen,项目名称:dswork,代码行数:32,代码来源:SQLiteDialect.java

示例8: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {

		super();
		registerColumnType(Types.BIT, "integer");
		registerColumnType(Types.TINYINT, "tinyint");
		registerColumnType(Types.SMALLINT, "smallint");
		registerColumnType(Types.INTEGER, "integer");
		registerColumnType(Types.BIGINT, "bigint");
		registerColumnType(Types.FLOAT, "float");
		registerColumnType(Types.REAL, "real");
		registerColumnType(Types.DOUBLE, "double");
		registerColumnType(Types.NUMERIC, "numeric");
		registerColumnType(Types.DECIMAL, "decimal");
		registerColumnType(Types.CHAR, "char");
		registerColumnType(Types.VARCHAR, "varchar");
		registerColumnType(Types.LONGVARCHAR, "longvarchar");
		registerColumnType(Types.DATE, "date");
		registerColumnType(Types.TIME, "time");
		registerColumnType(Types.TIMESTAMP, "timestamp");
		registerColumnType(Types.BINARY, "blob");
		registerColumnType(Types.VARBINARY, "blob");
		registerColumnType(Types.LONGVARBINARY, "blob");
		// registerColumnType(Types.NULL, "null");
		registerColumnType(Types.BLOB, "blob");
		registerColumnType(Types.CLOB, "clob");
		registerColumnType(Types.BOOLEAN, "integer");

		registerFunction("concat", new VarArgsSQLFunction(StandardBasicTypes.STRING, "",
				"||", ""));
		registerFunction("mod", new SQLFunctionTemplate(StandardBasicTypes.INTEGER,
				"?1 % ?2"));
		registerFunction("substr", new StandardSQLFunction("substr",
				StandardBasicTypes.STRING));
		registerFunction("substring", new StandardSQLFunction("substr",
				StandardBasicTypes.STRING));
	}
 
开发者ID:StnetixDevTeam,项目名称:CloudRaid-DesktopApp,代码行数:37,代码来源:SQLiteDialect.java

示例9: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {
  registerColumnType(Types.BIT, "integer");
  registerColumnType(Types.TINYINT, "tinyint");
  registerColumnType(Types.SMALLINT, "smallint");
  registerColumnType(Types.INTEGER, "integer");
  registerColumnType(Types.BIGINT, "bigint");
  registerColumnType(Types.FLOAT, "float");
  registerColumnType(Types.REAL, "real");
  registerColumnType(Types.DOUBLE, "double");
  registerColumnType(Types.NUMERIC, "numeric");
  registerColumnType(Types.DECIMAL, "decimal");
  registerColumnType(Types.CHAR, "char");
  registerColumnType(Types.VARCHAR, "varchar");
  registerColumnType(Types.LONGVARCHAR, "longvarchar");
  registerColumnType(Types.DATE, "date");
  registerColumnType(Types.TIME, "time");
  registerColumnType(Types.TIMESTAMP, "timestamp");
  registerColumnType(Types.BINARY, "blob");
  registerColumnType(Types.VARBINARY, "blob");
  registerColumnType(Types.LONGVARBINARY, "blob");
  // registerColumnType(Types.NULL, "null");
  registerColumnType(Types.BLOB, "blob");
  registerColumnType(Types.CLOB, "clob");
  registerColumnType(Types.BOOLEAN, "integer");

  registerFunction( "concat", new VarArgsSQLFunction(StandardBasicTypes.STRING, "", "||", "") );
  registerFunction( "mod", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "?1 % ?2" ) );
  registerFunction( "substr", new StandardSQLFunction("substr", StandardBasicTypes.STRING) );
  registerFunction( "substring", new StandardSQLFunction( "substr", StandardBasicTypes.STRING ) );
}
 
开发者ID:cnasenberg,项目名称:sparrow,代码行数:31,代码来源:SQLiteDialect.java

示例10: InformixDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
/**
 * Creates new <code>InformixDialect</code> instance. Sets up the JDBC /
 * Informix type mappings.
 */
public InformixDialect() {
	super();

	registerColumnType(Types.BIGINT, "int8");
	registerColumnType(Types.BINARY, "byte");
	registerColumnType(Types.BIT, "smallint"); // Informix doesn't have a bit type
	registerColumnType(Types.CHAR, "char($l)");
	registerColumnType(Types.DATE, "date");
	registerColumnType(Types.DECIMAL, "decimal");
       registerColumnType(Types.DOUBLE, "float");
       registerColumnType(Types.FLOAT, "smallfloat");
	registerColumnType(Types.INTEGER, "integer");
	registerColumnType(Types.LONGVARBINARY, "blob"); // or BYTE
	registerColumnType(Types.LONGVARCHAR, "clob"); // or TEXT?
	registerColumnType(Types.NUMERIC, "decimal"); // or MONEY
	registerColumnType(Types.REAL, "smallfloat");
	registerColumnType(Types.SMALLINT, "smallint");
	registerColumnType(Types.TIMESTAMP, "datetime year to fraction(5)");
	registerColumnType(Types.TIME, "datetime hour to second");
	registerColumnType(Types.TINYINT, "smallint");
	registerColumnType(Types.VARBINARY, "byte");
	registerColumnType(Types.VARCHAR, "varchar($l)");
	registerColumnType(Types.VARCHAR, 255, "varchar($l)");
	registerColumnType(Types.VARCHAR, 32739, "lvarchar($l)");

	registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(", "||", ")" ) );
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:32,代码来源:InformixDialect.java

示例11: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {
  registerColumnType(Types.BIT, "integer");
  registerColumnType(Types.TINYINT, "tinyint");
  registerColumnType(Types.SMALLINT, "smallint");
  registerColumnType(Types.INTEGER, "integer");
  registerColumnType(Types.BIGINT, "bigint");
  registerColumnType(Types.FLOAT, "float");
  registerColumnType(Types.REAL, "real");
  registerColumnType(Types.DOUBLE, "double");
  registerColumnType(Types.NUMERIC, "numeric");
  registerColumnType(Types.DECIMAL, "decimal");
  registerColumnType(Types.CHAR, "char");
  registerColumnType(Types.VARCHAR, "varchar");
  registerColumnType(Types.LONGVARCHAR, "longvarchar");
  registerColumnType(Types.DATE, "date");
  registerColumnType(Types.TIME, "time");
  registerColumnType(Types.TIMESTAMP, "timestamp");
  registerColumnType(Types.BINARY, "blob");
  registerColumnType(Types.VARBINARY, "blob");
  registerColumnType(Types.LONGVARBINARY, "blob");
  // registerColumnType(Types.NULL, "null");
  registerColumnType(Types.BLOB, "blob");
  registerColumnType(Types.CLOB, "clob");
  registerColumnType(Types.BOOLEAN, "integer");

  registerFunction("concat", new VarArgsSQLFunction(StringType.INSTANCE, "", "||", ""));
  registerFunction("mod", new SQLFunctionTemplate(IntegerType.INSTANCE, "?1 % ?2"));
  registerFunction("substr", new StandardSQLFunction("substr", StringType.INSTANCE));
  registerFunction("substring", new StandardSQLFunction("substr", StringType.INSTANCE));
}
 
开发者ID:tloszabno,项目名称:FirefightersCenter,代码行数:31,代码来源:SQLiteDialect.java

示例12: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {
	super();
	registerColumnType(Types.BIT, "integer");
	registerColumnType(Types.TINYINT, "tinyint");
	registerColumnType(Types.SMALLINT, "smallint");
	registerColumnType(Types.INTEGER, "integer");
	registerColumnType(Types.BIGINT, "bigint");
	registerColumnType(Types.FLOAT, "float");
	registerColumnType(Types.REAL, "real");
	registerColumnType(Types.DOUBLE, "double");
	registerColumnType(Types.NUMERIC, "numeric");
	registerColumnType(Types.DECIMAL, "decimal");
	registerColumnType(Types.CHAR, "char");
	registerColumnType(Types.VARCHAR, "varchar");
	registerColumnType(Types.LONGVARCHAR, "longvarchar");
	registerColumnType(Types.DATE, "date");
	registerColumnType(Types.TIME, "time");
	registerColumnType(Types.TIMESTAMP, "timestamp");
	registerColumnType(Types.BINARY, "blob");
	registerColumnType(Types.VARBINARY, "blob");
	registerColumnType(Types.LONGVARBINARY, "blob");
	// registerColumnType(Types.NULL, "null");
	registerColumnType(Types.BLOB, "blob");
	registerColumnType(Types.CLOB, "clob");
	registerColumnType(Types.BOOLEAN, "integer");

	registerFunction("concat", new VarArgsSQLFunction(StandardBasicTypes.STRING, "",
			"||", ""));
	registerFunction("mod", new SQLFunctionTemplate(StandardBasicTypes.INTEGER,
			"?1 % ?2"));
	registerFunction("substr", new StandardSQLFunction("substr",
			StandardBasicTypes.STRING));
	registerFunction("substring", new StandardSQLFunction("substr",
			StandardBasicTypes.STRING));
}
 
开发者ID:webdsl,项目名称:webdsl,代码行数:36,代码来源:SQLiteDialect.java

示例13: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {
registerColumnType(Types.BIT, "boolean");
//registerColumnType(Types.TINYINT, "tinyint");
//registerColumnType(Types.SMALLINT, "smallint");
//registerColumnType(Types.INTEGER, "integer");
//registerColumnType(Types.BIGINT, "bigint");
//registerColumnType(Types.FLOAT, "float");
//registerColumnType(Types.REAL, "real");
//registerColumnType(Types.DOUBLE, "double");
//registerColumnType(Types.NUMERIC, "numeric($p, $s)");
registerColumnType(Types.DECIMAL, "decimal");
registerColumnType(Types.CHAR, "char");
registerColumnType(Types.VARCHAR, "varchar($l)");
registerColumnType(Types.LONGVARCHAR, "longvarchar");
//registerColumnType(Types.DATE, "date");
//registerColumnType(Types.TIME, "time");
registerColumnType(Types.TIMESTAMP, "datetime");
registerColumnType(Types.BINARY, "blob");
registerColumnType(Types.VARBINARY, "blob");
registerColumnType(Types.LONGVARBINARY, "blob");
//registerColumnType(Types.BLOB, "blob");
//registerColumnType(Types.CLOB, "clob");
//registerColumnType(Types.BOOLEAN, "boolean");

registerFunction( "concat", new VarArgsSQLFunction(StandardBasicTypes.STRING, "", "||", "") );
registerFunction( "mod", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "?1 % ?2" ) );
registerFunction( "quote", new StandardSQLFunction("quote", StandardBasicTypes.STRING) );
registerFunction( "random", new NoArgSQLFunction("random", StandardBasicTypes.INTEGER) );
registerFunction( "round", new StandardSQLFunction("round") );
registerFunction( "substr", new StandardSQLFunction("substr", StandardBasicTypes.STRING) );}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:31,代码来源:SQLiteDialect.java

示例14: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {
	super();
	registerColumnType(Types.BIT, "integer");
	registerColumnType(Types.TINYINT, "tinyint");
	registerColumnType(Types.SMALLINT, "smallint");
	registerColumnType(Types.INTEGER, "integer");
	registerColumnType(Types.BIGINT, "bigint");
	registerColumnType(Types.FLOAT, "float");
	registerColumnType(Types.REAL, "real");
	registerColumnType(Types.DOUBLE, "double");
	registerColumnType(Types.NUMERIC, "numeric");
	registerColumnType(Types.DECIMAL, "decimal");
	registerColumnType(Types.CHAR, "char");
	registerColumnType(Types.VARCHAR, "varchar");
	registerColumnType(Types.LONGVARCHAR, "longvarchar");
	registerColumnType(Types.DATE, "date");
	registerColumnType(Types.TIME, "time");
	registerColumnType(Types.TIMESTAMP, "timestamp");
	registerColumnType(Types.BINARY, "blob");
	registerColumnType(Types.VARBINARY, "blob");
	registerColumnType(Types.LONGVARBINARY, "blob");
	// registerColumnType(Types.NULL, "null");
	registerColumnType(Types.BLOB, "blob");
	registerColumnType(Types.CLOB, "clob");
	registerColumnType(Types.BOOLEAN, "integer");

	 registerFunction( "concat", new VarArgsSQLFunction(Hibernate.STRING, "", "||", "") );
	 registerFunction( "mod", new SQLFunctionTemplate( Hibernate.INTEGER, "?1 % ?2" ) );
	 registerFunction( "substr", new StandardSQLFunction("substr", Hibernate.STRING) );
	 registerFunction( "substring", new StandardSQLFunction( "substr", Hibernate.STRING ) );
}
 
开发者ID:poli-libras,项目名称:poli-libras,代码行数:32,代码来源:SQLiteDialect.java

示例15: SQLiteDialect

import org.hibernate.dialect.function.VarArgsSQLFunction; //导入依赖的package包/类
public SQLiteDialect() {
    registerColumnType(Types.BIT, "boolean");
    registerColumnType(Types.TINYINT, "tinyint");
    registerColumnType(Types.SMALLINT, "smallint");
    registerColumnType(Types.INTEGER, "integer");
    registerColumnType(Types.BIGINT, "bigint");
    registerColumnType(Types.FLOAT, "float");
    registerColumnType(Types.REAL, "real");
    registerColumnType(Types.DOUBLE, "double");
    registerColumnType(Types.NUMERIC, "numeric($p, $s)");
    registerColumnType(Types.DECIMAL, "decimal");
    registerColumnType(Types.CHAR, "char");
    registerColumnType(Types.VARCHAR, "varchar($l)");
    registerColumnType(Types.LONGVARCHAR, "longvarchar");
    registerColumnType(Types.DATE, "date");
    registerColumnType(Types.TIME, "time");
    registerColumnType(Types.TIMESTAMP, "datetime");
    registerColumnType(Types.BINARY, "blob");
    registerColumnType(Types.VARBINARY, "blob");
    registerColumnType(Types.LONGVARBINARY, "blob");
    registerColumnType(Types.BLOB, "blob");
    registerColumnType(Types.CLOB, "clob");
    registerColumnType(Types.BOOLEAN, "boolean");

    registerFunction("concat", new VarArgsSQLFunction(StandardBasicTypes.STRING, "", "||", ""));
    registerFunction("mod", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "?1 % ?2"));
    registerFunction("quote", new StandardSQLFunction("quote", StandardBasicTypes.STRING));
    registerFunction("random", new NoArgSQLFunction("random", StandardBasicTypes.INTEGER));
    registerFunction("round", new StandardSQLFunction("round"));
    registerFunction("substr", new StandardSQLFunction("substr", StandardBasicTypes.STRING));
    registerFunction("trim", new AbstractAnsiTrimEmulationFunction() {
        protected SQLFunction resolveBothSpaceTrimFunction() {
            return new SQLFunctionTemplate(StandardBasicTypes.STRING, "trim(?1)");
        }

        protected SQLFunction resolveBothSpaceTrimFromFunction() {
            return new SQLFunctionTemplate(StandardBasicTypes.STRING, "trim(?2)");
        }

        protected SQLFunction resolveLeadingSpaceTrimFunction() {
            return new SQLFunctionTemplate(StandardBasicTypes.STRING, "ltrim(?1)");
        }

        protected SQLFunction resolveTrailingSpaceTrimFunction() {
            return new SQLFunctionTemplate(StandardBasicTypes.STRING, "rtrim(?1)");
        }

        protected SQLFunction resolveBothTrimFunction() {
            return new SQLFunctionTemplate(StandardBasicTypes.STRING, "trim(?1, ?2)");
        }

        protected SQLFunction resolveLeadingTrimFunction() {
            return new SQLFunctionTemplate(StandardBasicTypes.STRING, "ltrim(?1, ?2)");
        }

        protected SQLFunction resolveTrailingTrimFunction() {
            return new SQLFunctionTemplate(StandardBasicTypes.STRING, "rtrim(?1, ?2)");
        }
    });
}
 
开发者ID:ZsoltFabok,项目名称:sqlite-dialect,代码行数:61,代码来源:SQLiteDialect.java


注:本文中的org.hibernate.dialect.function.VarArgsSQLFunction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。