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


Java SqlType.LONG属性代码示例

本文整理汇总了Java中com.j256.ormlite.field.SqlType.LONG属性的典型用法代码示例。如果您正苦于以下问题:Java SqlType.LONG属性的具体用法?Java SqlType.LONG怎么用?Java SqlType.LONG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.j256.ormlite.field.SqlType的用法示例。


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

示例1: configureGeneratedIdSequence

@Override
protected void configureGeneratedIdSequence(StringBuilder sb, FieldType fieldType, List<String> statementsBefore,
		List<String> additionalArgs, List<String> queriesAfter) {
	// needs to match dropColumnArg()
	StringBuilder seqSb = new StringBuilder(128);
	seqSb.append("CREATE SEQUENCE ");
	appendEscapedEntityName(seqSb, fieldType.getGeneratedIdSequence());
	if (fieldType.getSqlType() == SqlType.LONG) {
		seqSb.append(" AS BIGINT");
	} else {
		// integer is the default
	}
	// with hsqldb (as opposed to all else) the sequences start at 0, grumble
	seqSb.append(" START WITH 1");
	statementsBefore.add(seqSb.toString());
	sb.append("GENERATED BY DEFAULT AS IDENTITY ");
	configureId(sb, fieldType, statementsBefore, additionalArgs, queriesAfter);
}
 
开发者ID:j256,项目名称:ormlite-jdbc,代码行数:18,代码来源:HsqldbDatabaseType.java

示例2: appendLongType

protected void appendLongType(StringBuilder paramStringBuilder, FieldType paramFieldType, int paramInt)
{
  if ((paramFieldType.getSqlType() == SqlType.LONG) && (paramFieldType.isGeneratedId()))
  {
    paramStringBuilder.append("INTEGER");
    return;
  }
  paramStringBuilder.append("BIGINT");
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:9,代码来源:BaseSqliteDatabaseType.java

示例3: appendLongType

@Override
protected void appendLongType(StringBuilder sb, FieldType fieldType, int fieldWidth) {
	/*
	 * This is unfortunate. SQLIte requires that a generated-id have the string "INTEGER PRIMARY KEY AUTOINCREMENT"
	 * even though the maximum generated value is 64-bit. See configureGeneratedId below.
	 */
	if (fieldType.getSqlType() == SqlType.LONG && fieldType.isGeneratedId()) {
		sb.append("INTEGER");
	} else {
		sb.append("BIGINT");
	}
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:12,代码来源:BaseSqliteDatabaseType.java

示例4: configureGeneratedId

@Override
protected void configureGeneratedId(String tableName, StringBuilder sb, FieldType fieldType,
		List<String> statementsBefore, List<String> statementsAfter, List<String> additionalArgs,
		List<String> queriesAfter) {
	/*
	 * Even though the documentation talks about INTEGER, it is 64-bit with a maximum value of 9223372036854775807.
	 * See http://www.sqlite.org/faq.html#q1 and http://www.sqlite.org/autoinc.html
	 */
	if (fieldType.getSqlType() != SqlType.INTEGER && fieldType.getSqlType() != SqlType.LONG) {
		throw new IllegalArgumentException(
				"Sqlite requires that auto-increment generated-id be integer or long type");
	}
	sb.append("PRIMARY KEY AUTOINCREMENT ");
	// no additional call to configureId here
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:15,代码来源:BaseSqliteDatabaseType.java

示例5: ServiceParserDataPersister

public ServiceParserDataPersister() {
	super(SqlType.LONG, new Class<?>[] { ServiceParserData.class });
}
 
开发者ID:crsmoro,项目名称:vntscraper,代码行数:3,代码来源:ServiceParserDataPersister.java

示例6: DateLongType

private DateLongType()
{
  super(SqlType.LONG, new Class[0]);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:4,代码来源:DateLongType.java

示例7: LongObjectType

private LongObjectType()
{
  super(SqlType.LONG, new Class[] { Long.class });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:4,代码来源:LongObjectType.java

示例8: configureGeneratedId

protected void configureGeneratedId(String paramString, StringBuilder paramStringBuilder, FieldType paramFieldType, List<String> paramList1, List<String> paramList2, List<String> paramList3, List<String> paramList4)
{
  if ((paramFieldType.getSqlType() != SqlType.INTEGER) && (paramFieldType.getSqlType() != SqlType.LONG))
    throw new IllegalArgumentException("Sqlite requires that auto-increment generated-id be integer or long type");
  paramStringBuilder.append("PRIMARY KEY AUTOINCREMENT ");
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:6,代码来源:BaseSqliteDatabaseType.java

示例9: DateTimePersister

private DateTimePersister() {
	super(SqlType.LONG, new Class<?>[] { DateTime.class });
}
 
开发者ID:j256,项目名称:ormlite-jdbc,代码行数:3,代码来源:DateTimePersister.java

示例10: testCoverage

@Test
public void testCoverage() {
	new DateTimeType(SqlType.LONG, new Class[0]);
	assertEquals(DateTime.class, DateTimeType.getSingleton().getPrimaryClass());
}
 
开发者ID:j256,项目名称:ormlite-tests,代码行数:5,代码来源:DateTimeTypeTest.java

示例11: LongType

private LongType() {
	super(SqlType.LONG, new Class<?>[] { long.class });
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:3,代码来源:LongType.java

示例12: DateLongType

private DateLongType() {
	super(SqlType.LONG);
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:3,代码来源:DateLongType.java

示例13: LongObjectType

private LongObjectType() {
	super(SqlType.LONG, new Class<?>[] { Long.class });
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:3,代码来源:LongObjectType.java

示例14: DateTimeType

private DateTimeType() {
	super(SqlType.LONG);
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:3,代码来源:DateTimeType.java

示例15: testCoverage

@Test
public void testCoverage() {
	new LongType(SqlType.LONG, new Class[0]);
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:4,代码来源:LongTypeTest.java


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