com.impetus.kundera.index.Index.name()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(68)

本文整理了Java中com.impetus.kundera.index.Index.name()方法的一些代码示例,展示了Index.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index.name()方法的具体详情如下:
包路径:com.impetus.kundera.index.Index
类名称:Index
方法名:name

Index.name介绍

暂无

代码示例

代码示例来源:origin: Impetus/Kundera

public static boolean isColumnInEmbeddableIndexable(Field embeddedField, String columnFieldName)
{
  Class<?> embeddableClass = PropertyAccessorHelper.getGenericClass(embeddedField);
    IndexCollection indexCollection = embeddableClass.getAnnotation(IndexCollection.class);
  if (indexCollection != null && indexCollection.columns() != null)
  {
    for (com.impetus.kundera.index.Index column : indexCollection.columns())
    {
      if (columnFieldName != null && column != null && column.name() != null
          && column.name().equals(columnFieldName))
      {
        return true;
      }
    }
  }
   return false;
}

代码示例来源:origin: Impetus/Kundera

/**
 * @param entityClazz
 * @param pis
 * @param columnsNameToBeIndexed
 * @param columnsToBeIndexed
 */
private static void getPropertyIndexes(Class<?> entityClazz, Map<String, PropertyIndex> pis,
    List<String> columnsNameToBeIndexed, Map<String, com.impetus.kundera.index.Index> columnsToBeIndexed)
{
  for (Field f : entityClazz.getDeclaredFields())
  {
    if (f.isAnnotationPresent(Column.class))
    {
      String fieldName = f.getName();
      if (columnsToBeIndexed != null && !columnsToBeIndexed.isEmpty()
          && columnsToBeIndexed.containsKey(fieldName))
      {
        com.impetus.kundera.index.Index indexedColumn = columnsToBeIndexed.get(fieldName);
        pis.put(indexedColumn.name(),
            populatePropertyIndex(indexedColumn.name(), indexedColumn.type(), indexedColumn.max(),
                indexedColumn.min(), f));
      }
      else if (columnsNameToBeIndexed != null && !columnsNameToBeIndexed.isEmpty()
          && columnsNameToBeIndexed.contains(fieldName))
      {
        pis.put(fieldName, populatePropertyIndex(fieldName, null, null, null, f));
      }
    }
  }
}

代码示例来源:origin: Impetus/Kundera

/**
 * Returns list of indexed columns on {@code @Embeddable} entity
 * 
 * @param entityMetadata
 *            entity metadata
 * @return list of indexed columns
 */
public static Map<String, PropertyIndex> getIndexesOnEmbeddable(Class<?> entityClazz)
{
  Map<String, PropertyIndex> pis = new HashMap<String, PropertyIndex>();
    IndexCollection indexes = entityClazz.getAnnotation(IndexCollection.class);
  List<String> columnsNameToBeIndexed = null;
  Map<String, com.impetus.kundera.index.Index> columnsToBeIndexed = null;
  if (null != indexes)
  {
    columnsToBeIndexed = new HashMap<String, com.impetus.kundera.index.Index>();
    if (indexes.columns() != null && indexes.columns().length != 0)
    {
      for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
      {
        columnsToBeIndexed.put(indexedColumn.name(), indexedColumn);
      }
    }
  }
    getPropertyIndexes(entityClazz, pis, columnsNameToBeIndexed, columnsToBeIndexed);
  return pis;
}

代码示例来源:origin: Impetus/Kundera

List<String> columnsNameToBeIndexed = new ArrayList<String>();
for (com.impetus.kundera.index.Index indexedColumn : indexes.columns()) {
  Attribute attrib = metaModel.getEntityAttribute(entity.getClass(), indexedColumn.name());
  columnsNameToBeIndexed.add(((AbstractAttribute) attrib).getJPAColumnName());

代码示例来源:origin: Impetus/Kundera

prepareCompositeIndexName(indexedColumn.name(), entityType, metadata),
    populatePropertyIndex(indexedColumn.indexName(), indexedColumn.type(), null, null, null));
indexedColumnsMap.put(indexedColumn.name(), indexedColumn);

相关文章

微信公众号

最新文章

更多