本文整理汇总了Java中com.j256.ormlite.field.FieldType.isForeignCollection方法的典型用法代码示例。如果您正苦于以下问题:Java FieldType.isForeignCollection方法的具体用法?Java FieldType.isForeignCollection怎么用?Java FieldType.isForeignCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.j256.ormlite.field.FieldType
的用法示例。
在下文中一共展示了FieldType.isForeignCollection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateColumnExpression
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
public StatementBuilder<T, ID> updateColumnExpression(String paramString1, String paramString2)
{
FieldType localFieldType = verifyColumnName(paramString1);
if (localFieldType.isForeignCollection())
throw new SQLException("Can't update foreign colletion field: " + paramString1);
addUpdateColumnToList(paramString1, new SetExpression(paramString1, localFieldType, paramString2));
return this;
}
示例2: updateColumnValue
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
public StatementBuilder<T, ID> updateColumnValue(String paramString, Object paramObject)
{
FieldType localFieldType = verifyColumnName(paramString);
if (localFieldType.isForeignCollection())
throw new SQLException("Can't update foreign colletion field: " + paramString);
addUpdateColumnToList(paramString, new SetValue(paramString, localFieldType, paramObject));
return this;
}
示例3: isFieldCreatable
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
private static boolean isFieldCreatable(DatabaseType paramDatabaseType, FieldType paramFieldType)
{
if (paramFieldType.isForeignCollection())
return false;
if ((paramDatabaseType.isIdSequenceNeeded()) && (paramDatabaseType.isSelectSequenceBeforeInsert()))
return true;
return (!paramFieldType.isGeneratedId()) || (paramFieldType.isSelfGeneratedId()) || (paramFieldType.isAllowGeneratedIdInsert());
}
示例4: TableInfo
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
public TableInfo(DatabaseType paramDatabaseType, BaseDaoImpl<T, ID> paramBaseDaoImpl, DatabaseTableConfig<T> paramDatabaseTableConfig)
{
this.baseDaoImpl = paramBaseDaoImpl;
this.dataClass = paramDatabaseTableConfig.getDataClass();
this.tableName = paramDatabaseTableConfig.getTableName();
this.fieldTypes = paramDatabaseTableConfig.getFieldTypes(paramDatabaseType);
Object localObject = null;
boolean bool = false;
int i = 0;
for (FieldType localFieldType2 : this.fieldTypes)
{
if ((localFieldType2.isId()) || (localFieldType2.isGeneratedId()) || (localFieldType2.isGeneratedIdSequence()))
{
if (localObject != null)
throw new SQLException("More than 1 idField configured for class " + this.dataClass + " (" + localObject + "," + localFieldType2 + ")");
localObject = localFieldType2;
}
if (localFieldType2.isForeignAutoCreate())
bool = true;
if (localFieldType2.isForeignCollection())
i++;
}
this.idField = localObject;
this.constructor = paramDatabaseTableConfig.getConstructor();
this.foreignAutoCreate = bool;
if (i == 0)
{
this.foreignCollections = NO_FOREIGN_COLLECTIONS;
return;
}
this.foreignCollections = new FieldType[i];
int m = 0;
for (FieldType localFieldType1 : this.fieldTypes)
if (localFieldType1.isForeignCollection())
{
this.foreignCollections[m] = localFieldType1;
m++;
}
}
示例5: isFieldUpdatable
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
private static boolean isFieldUpdatable(FieldType paramFieldType1, FieldType paramFieldType2)
{
return (paramFieldType1 != paramFieldType2) && (!paramFieldType1.isForeignCollection());
}
示例6: mapRow
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
public T mapRow(DatabaseResults paramDatabaseResults)
{
Object localObject1;
if (this.columnPositions == null)
localObject1 = new HashMap();
else
localObject1 = this.columnPositions;
ObjectCache localObjectCache = paramDatabaseResults.getObjectCache();
if (localObjectCache != null)
{
Object localObject5 = this.idField.resultToJava(paramDatabaseResults, (Map)localObject1);
Object localObject6 = localObjectCache.get(this.clazz, localObject5);
if (localObject6 != null)
return localObject6;
}
Object localObject2 = this.tableInfo.createObject();
Object localObject3 = null;
int i = 0;
for (FieldType localFieldType2 : this.resultsFieldTypes)
if (localFieldType2.isForeignCollection())
{
i = 1;
}
else
{
Object localObject4 = localFieldType2.resultToJava(paramDatabaseResults, (Map)localObject1);
if ((localObject4 != null) && (this.parent != null) && (localFieldType2.getField().getType() == this.parent.getClass()) && (localObject4.equals(this.parentId)))
localFieldType2.assignField(localObject2, this.parent, true, localObjectCache);
else
localFieldType2.assignField(localObject2, localObject4, false, localObjectCache);
if (localFieldType2 == this.idField)
localObject3 = localObject4;
}
if (i != 0)
for (FieldType localFieldType1 : this.resultsFieldTypes)
if (localFieldType1.isForeignCollection())
{
BaseForeignCollection localBaseForeignCollection = localFieldType1.buildForeignCollection(localObject2, localObject3);
if (localBaseForeignCollection != null)
localFieldType1.assignField(localObject2, localBaseForeignCollection, false, localObjectCache);
}
if ((localObjectCache != null) && (localObject3 != null))
localObjectCache.put(this.clazz, localObject3, localObject2);
if (this.columnPositions == null)
this.columnPositions = ((Map)localObject1);
return localObject2;
}
示例7: appendColumns
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
private void appendColumns(StringBuilder paramStringBuilder)
{
if (this.selectColumnList == null)
{
if (this.addTableName)
{
this.databaseType.appendEscapedEntityName(paramStringBuilder, this.tableName);
paramStringBuilder.append('.');
}
paramStringBuilder.append("* ");
this.resultFieldTypes = this.tableInfo.getFieldTypes();
return;
}
int i = 1;
int j;
if (this.isInnerQuery)
j = 1;
else
j = 0;
ArrayList localArrayList = new ArrayList(1 + this.selectColumnList.size());
Iterator localIterator = this.selectColumnList.iterator();
while (localIterator.hasNext())
{
String str = (String)localIterator.next();
FieldType localFieldType = this.tableInfo.getFieldTypeByColumnName(str);
if (localFieldType.isForeignCollection())
{
localArrayList.add(localFieldType);
}
else
{
if (i != 0)
i = 0;
else
paramStringBuilder.append(',');
appendFieldColumnName(paramStringBuilder, localFieldType, localArrayList);
if (localFieldType == this.idField)
j = 1;
}
}
if ((j == 0) && (this.selectIdColumn))
{
if (i == 0)
paramStringBuilder.append(',');
appendFieldColumnName(paramStringBuilder, this.idField, localArrayList);
}
paramStringBuilder.append(' ');
this.resultFieldTypes = ((FieldType[])localArrayList.toArray(new FieldType[localArrayList.size()]));
}
示例8: addCreateTableStatements
import com.j256.ormlite.field.FieldType; //导入方法依赖的package包/类
private static <T, ID> void addCreateTableStatements(DatabaseType paramDatabaseType, TableInfo<T, ID> paramTableInfo, List<String> paramList1, List<String> paramList2, boolean paramBoolean)
{
StringBuilder localStringBuilder = new StringBuilder(256);
localStringBuilder.append("CREATE TABLE ");
if ((paramBoolean) && (paramDatabaseType.isCreateIfNotExistsSupported()))
localStringBuilder.append("IF NOT EXISTS ");
paramDatabaseType.appendEscapedEntityName(localStringBuilder, paramTableInfo.getTableName());
localStringBuilder.append(" (");
ArrayList localArrayList1 = new ArrayList();
ArrayList localArrayList2 = new ArrayList();
ArrayList localArrayList3 = new ArrayList();
int i = 1;
for (FieldType localFieldType : paramTableInfo.getFieldTypes())
if (!localFieldType.isForeignCollection())
{
if (i != 0)
i = 0;
else
localStringBuilder.append(", ");
String str2 = localFieldType.getColumnDefinition();
if (str2 == null)
{
paramDatabaseType.appendColumnArg(paramTableInfo.getTableName(), localStringBuilder, localFieldType, localArrayList1, localArrayList2, localArrayList3, paramList2);
}
else
{
paramDatabaseType.appendEscapedEntityName(localStringBuilder, localFieldType.getColumnName());
localStringBuilder.append(' ').append(str2).append(' ');
}
}
paramDatabaseType.addPrimaryKeySql(paramTableInfo.getFieldTypes(), localArrayList1, localArrayList2, localArrayList3, paramList2);
paramDatabaseType.addUniqueComboSql(paramTableInfo.getFieldTypes(), localArrayList1, localArrayList2, localArrayList3, paramList2);
Iterator localIterator = localArrayList1.iterator();
while (localIterator.hasNext())
{
String str1 = (String)localIterator.next();
localStringBuilder.append(", ").append(str1);
}
localStringBuilder.append(") ");
paramDatabaseType.appendCreateTableSuffix(localStringBuilder);
paramList1.addAll(localArrayList2);
paramList1.add(localStringBuilder.toString());
paramList1.addAll(localArrayList3);
addCreateIndexStatements(paramDatabaseType, paramTableInfo, paramList1, paramBoolean, false);
addCreateIndexStatements(paramDatabaseType, paramTableInfo, paramList1, paramBoolean, true);
}