当前位置: 首页>>代码示例>>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;未经允许,请勿转载。