本文整理汇总了Java中com.j256.ormlite.field.FieldType.extractJavaFieldToSqlArgValue方法的典型用法代码示例。如果您正苦于以下问题:Java FieldType.extractJavaFieldToSqlArgValue方法的具体用法?Java FieldType.extractJavaFieldToSqlArgValue怎么用?Java FieldType.extractJavaFieldToSqlArgValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.j256.ormlite.field.FieldType
的用法示例。
在下文中一共展示了FieldType.extractJavaFieldToSqlArgValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteObjects
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
public static <T, ID> int deleteObjects(DatabaseType paramDatabaseType, TableInfo<T, ID> paramTableInfo, DatabaseConnection paramDatabaseConnection, Collection<T> paramCollection, ObjectCache paramObjectCache)
{
MappedDeleteCollection localMappedDeleteCollection = build(paramDatabaseType, paramTableInfo, paramCollection.size());
Object[] arrayOfObject = new Object[paramCollection.size()];
FieldType localFieldType = paramTableInfo.getIdField();
int i = 0;
Iterator localIterator = paramCollection.iterator();
while (localIterator.hasNext())
{
arrayOfObject[i] = localFieldType.extractJavaFieldToSqlArgValue(localIterator.next());
i++;
}
return updateRows(paramDatabaseConnection, paramTableInfo.getDataClass(), localMappedDeleteCollection, arrayOfObject, paramObjectCache);
}
示例2: getFieldObjects
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
protected Object[] getFieldObjects(Object paramObject)
{
Object[] arrayOfObject = new Object[this.argFieldTypes.length];
for (int i = 0; i < this.argFieldTypes.length; i++)
{
FieldType localFieldType = this.argFieldTypes[i];
if (localFieldType.isAllowGeneratedIdInsert())
arrayOfObject[i] = localFieldType.getFieldValueIfNotDefault(paramObject);
else
arrayOfObject[i] = localFieldType.extractJavaFieldToSqlArgValue(paramObject);
if ((arrayOfObject[i] == null) && (localFieldType.getDefaultValue() != null))
arrayOfObject[i] = localFieldType.getDefaultValue();
}
return arrayOfObject;
}