本文整理汇总了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);
}
示例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");
}
示例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");
}
}
示例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
}
示例5: ServiceParserDataPersister
public ServiceParserDataPersister() {
super(SqlType.LONG, new Class<?>[] { ServiceParserData.class });
}
示例6: DateLongType
private DateLongType()
{
super(SqlType.LONG, new Class[0]);
}
示例7: LongObjectType
private LongObjectType()
{
super(SqlType.LONG, new Class[] { Long.class });
}
示例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 ");
}
示例9: DateTimePersister
private DateTimePersister() {
super(SqlType.LONG, new Class<?>[] { DateTime.class });
}
示例10: testCoverage
@Test
public void testCoverage() {
new DateTimeType(SqlType.LONG, new Class[0]);
assertEquals(DateTime.class, DateTimeType.getSingleton().getPrimaryClass());
}
示例11: LongType
private LongType() {
super(SqlType.LONG, new Class<?>[] { long.class });
}
示例12: DateLongType
private DateLongType() {
super(SqlType.LONG);
}
示例13: LongObjectType
private LongObjectType() {
super(SqlType.LONG, new Class<?>[] { Long.class });
}
示例14: DateTimeType
private DateTimeType() {
super(SqlType.LONG);
}
示例15: testCoverage
@Test
public void testCoverage() {
new LongType(SqlType.LONG, new Class[0]);
}