當前位置: 首頁>>代碼示例>>Java>>正文


Java ForeignCollectionField類代碼示例

本文整理匯總了Java中com.j256.ormlite.field.ForeignCollectionField的典型用法代碼示例。如果您正苦於以下問題:Java ForeignCollectionField類的具體用法?Java ForeignCollectionField怎麽用?Java ForeignCollectionField使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ForeignCollectionField類屬於com.j256.ormlite.field包,在下文中一共展示了ForeignCollectionField類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fromForeignCollection

import com.j256.ormlite.field.ForeignCollectionField; //導入依賴的package包/類
public static FieldBindings fromForeignCollection(Element field, ForeignCollectionField foreignCollection) {
    FieldBindings bindings = new FieldBindings();
    bindings.fieldName = field.getSimpleName().toString();
    if (foreignCollection.columnName().length() > 0) {
        bindings.columnName = foreignCollection.columnName();
    }
    bindings.foreignCollection = true;
    bindings.foreignCollectionEager = foreignCollection.eager();
    @SuppressWarnings("deprecation")
    int maxEagerLevel = foreignCollection.maxEagerForeignCollectionLevel();
    if (maxEagerLevel != ForeignCollectionField.MAX_EAGER_LEVEL) {
        bindings.foreignCollectionMaxEagerLevel = maxEagerLevel;
    } else {
        bindings.foreignCollectionMaxEagerLevel = foreignCollection.maxEagerLevel();
    }
    bindings.foreignCollectionOrderColumnName = valueIfNotBlank(foreignCollection.orderColumnName());
    bindings.foreignCollectionOrderAscending = foreignCollection.orderAscending();
    bindings.foreignCollectionColumnName = valueIfNotBlank(foreignCollection.columnName());
    String foreignFieldName = valueIfNotBlank(foreignCollection.foreignFieldName());
    if (foreignFieldName == null) {
        @SuppressWarnings("deprecation")
        String foreignColumnName = valueIfNotBlank(foreignCollection.foreignColumnName());
        bindings.foreignCollectionForeignFieldName = valueIfNotBlank(foreignColumnName);
    } else {
        bindings.foreignCollectionForeignFieldName = foreignFieldName;
    }
    return bindings;
}
 
開發者ID:koesie10,項目名稱:ormlite-processor,代碼行數:29,代碼來源:FieldBindings.java

示例2: classHasAnnotations

import com.j256.ormlite.field.ForeignCollectionField; //導入依賴的package包/類
private static boolean classHasAnnotations(Class<?> paramClass)
{
  while (paramClass != null)
  {
    if (paramClass.getAnnotation(DatabaseTable.class) != null)
      return true;
    Field[] arrayOfField;
    try
    {
      arrayOfField = paramClass.getDeclaredFields();
    }
    catch (Throwable localThrowable1)
    {
      System.err.println("Could not load get delcared fields from: " + paramClass);
      System.err.println("     " + localThrowable1);
      return false;
    }
    int i = arrayOfField.length;
    for (int j = 0; j < i; j++)
    {
      Field localField = arrayOfField[j];
      if ((localField.getAnnotation(DatabaseField.class) != null) || (localField.getAnnotation(ForeignCollectionField.class) != null))
        return true;
    }
    try
    {
      paramClass = paramClass.getSuperclass();
    }
    catch (Throwable localThrowable2)
    {
      System.err.println("Could not get super class for: " + paramClass);
      System.err.println("     " + localThrowable2);
      return false;
    }
  }
  return false;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:38,代碼來源:OrmLiteConfigUtil.java


注:本文中的com.j256.ormlite.field.ForeignCollectionField類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。