本文整理汇总了Java中com.j256.ormlite.field.SqlType.INTEGER属性的典型用法代码示例。如果您正苦于以下问题:Java SqlType.INTEGER属性的具体用法?Java SqlType.INTEGER怎么用?Java SqlType.INTEGER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.j256.ormlite.field.SqlType
的用法示例。
在下文中一共展示了SqlType.INTEGER属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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
}
示例2: testSqlTypeValueConst
@Test
public void testSqlTypeValueConst() {
int val = 12;
SqlType type = SqlType.INTEGER;
ThreadLocalSelectArg arg = new ThreadLocalSelectArg(type, val);
assertTrue(arg.isValueSet());
assertEquals(val, arg.getValue());
assertEquals(type, arg.getSqlType());
}
示例3: EnumIntegerType
private EnumIntegerType()
{
super(SqlType.INTEGER, new Class[0]);
}
示例4: IntegerObjectType
private IntegerObjectType()
{
super(SqlType.INTEGER, new Class[] { Integer.class });
}
示例5: 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 ");
}
示例6: getSqlType
@Override
public SqlType getSqlType() {
return SqlType.INTEGER;
}
示例7: IntType
private IntType() {
super(SqlType.INTEGER, new Class<?>[] { int.class });
}
示例8: DateIntegerType
private DateIntegerType() {
super(SqlType.INTEGER);
}
示例9: EnumIntegerType
private EnumIntegerType() {
super(SqlType.INTEGER);
}
示例10: IntegerObjectType
private IntegerObjectType() {
super(SqlType.INTEGER, new Class<?>[] { Integer.class });
}
示例11: BooleanIntegerType
public BooleanIntegerType() {
super(SqlType.INTEGER);
}
示例12: testCoverage
@Test
public void testCoverage() {
new IntType(SqlType.INTEGER, new Class[0]);
}
示例13: testCoverage
@Test
public void testCoverage() {
new EnumIntegerType(SqlType.INTEGER, new Class[0]);
}
示例14: testCoverage
@Test
public void testCoverage() {
new DateIntegerType(SqlType.INTEGER, new Class[0]);
}