com.impetus.kundera.index.Index类的使用及代码示例

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

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

Index介绍

暂无

代码示例

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

  1. @Entity
  2. @Table(name = "USER")
  3. @IndexCollection(columns = { @Index(name = "name"), @Index(name = "age") })
  4. public class UserInformation

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

  1. /**
  2. * @param entityClazz
  3. * @param pis
  4. * @param columnsNameToBeIndexed
  5. * @param columnsToBeIndexed
  6. */
  7. private static void getPropertyIndexes(Class<?> entityClazz, Map<String, PropertyIndex> pis,
  8. List<String> columnsNameToBeIndexed, Map<String, com.impetus.kundera.index.Index> columnsToBeIndexed)
  9. {
  10. for (Field f : entityClazz.getDeclaredFields())
  11. {
  12. if (f.isAnnotationPresent(Column.class))
  13. {
  14. String fieldName = f.getName();
  15. if (columnsToBeIndexed != null && !columnsToBeIndexed.isEmpty()
  16. && columnsToBeIndexed.containsKey(fieldName))
  17. {
  18. com.impetus.kundera.index.Index indexedColumn = columnsToBeIndexed.get(fieldName);
  19. pis.put(indexedColumn.name(),
  20. populatePropertyIndex(indexedColumn.name(), indexedColumn.type(), indexedColumn.max(),
  21. indexedColumn.min(), f));
  22. }
  23. else if (columnsNameToBeIndexed != null && !columnsNameToBeIndexed.isEmpty()
  24. && columnsNameToBeIndexed.contains(fieldName))
  25. {
  26. pis.put(fieldName, populatePropertyIndex(fieldName, null, null, null, f));
  27. }
  28. }
  29. }
  30. }

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

  1. public static boolean isColumnInEmbeddableIndexable(Field embeddedField, String columnFieldName)
  2. {
  3. Class<?> embeddableClass = PropertyAccessorHelper.getGenericClass(embeddedField);
  4. IndexCollection indexCollection = embeddableClass.getAnnotation(IndexCollection.class);
  5. if (indexCollection != null && indexCollection.columns() != null)
  6. {
  7. for (com.impetus.kundera.index.Index column : indexCollection.columns())
  8. {
  9. if (columnFieldName != null && column != null && column.name() != null
  10. && column.name().equals(columnFieldName))
  11. {
  12. return true;
  13. }
  14. }
  15. }
  16. return false;
  17. }

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

  1. /**
  2. * Returns list of indexed columns on {@code @Embeddable} entity
  3. *
  4. * @param entityMetadata
  5. * entity metadata
  6. * @return list of indexed columns
  7. */
  8. public static Map<String, PropertyIndex> getIndexesOnEmbeddable(Class<?> entityClazz)
  9. {
  10. Map<String, PropertyIndex> pis = new HashMap<String, PropertyIndex>();
  11. IndexCollection indexes = entityClazz.getAnnotation(IndexCollection.class);
  12. List<String> columnsNameToBeIndexed = null;
  13. Map<String, com.impetus.kundera.index.Index> columnsToBeIndexed = null;
  14. if (null != indexes)
  15. {
  16. columnsToBeIndexed = new HashMap<String, com.impetus.kundera.index.Index>();
  17. if (indexes.columns() != null && indexes.columns().length != 0)
  18. {
  19. for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
  20. {
  21. columnsToBeIndexed.put(indexedColumn.name(), indexedColumn);
  22. }
  23. }
  24. }
  25. getPropertyIndexes(entityClazz, pis, columnsNameToBeIndexed, columnsToBeIndexed);
  26. return pis;
  27. }

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

  1. @Entity
  2. @Table(name = "UserInformation")
  3. @IndexCollection(columns = { @Index(name = "name"), @Index(name = "age") })
  4. public class UserInformation

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

  1. for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
  2. if (indexedColumn.type().equals("composite"))
  3. prepareCompositeIndexName(indexedColumn.name(), entityType, metadata),
  4. populatePropertyIndex(indexedColumn.indexName(), indexedColumn.type(), null, null, null));
  5. indexedColumnsMap.put(indexedColumn.name(), indexedColumn);
  6. String indexName = StringUtils.isBlank(indexedColumn.indexName()) ? columnName : indexedColumn
  7. .indexName();
  8. metadata.addIndexProperty(
  9. columnName,
  10. populatePropertyIndex(indexName, indexedColumn.type(), indexedColumn.max(),
  11. indexedColumn.min(), (Field) attrib.getJavaMember()));

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

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

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

  1. @Embeddable
  2. @IndexCollection(columns = { @Index(name = "tweetDate"), @Index(name = "firstName") })
  3. public class CompositeUser

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

  1. @Embeddable
  2. @IndexCollection(columns = { @Index(name = "currentLocation", type = "GEO2D", min = -100, max = 500),
  3. @Index(name = "previousLocation", type = "GEO2D", min = 100, max = 400) })
  4. public class Location

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

  1. @Entity
  2. @Table(name = "ADDRESS", schema = "TESTDB")
  3. @IndexCollection(columns = { @Index(name = "street") })
  4. public class AddressRDBMSOTM

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

  1. @Entity
  2. @Table(name = "ADDRESS", schema = "TESTDB")
  3. @IndexCollection(columns = { @Index(name = "street") })
  4. public class AddressRDBMSMTO

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

  1. @Entity
  2. @Table(name = "ADDRESS", schema = "KunderaTests@patest")
  3. @IndexCollection(columns = { @Index(name = "street") })
  4. public class AddressU1M

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

  1. @Embeddable
  2. @IndexCollection(columns={@Index(name="engineId")})
  3. public class CarEngine

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

  1. @Entity
  2. @Table(name = "AddressCouchOTM", schema = "couchdatabase@couchdb_pu")
  3. @IndexCollection(columns = { @Index(name = "street") })
  4. public class AddressCouchOTM

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

  1. @Entity
  2. @Table(name = "AddressMongoMTO", schema = "KunderaExamples@mongoTest")
  3. @IndexCollection(columns = { @Index(name = "street") })
  4. public class AddressMongoMTO

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

  1. @Entity
  2. @Table(name = "ADDRESS", schema = "KunderaTests@patest")
  3. @IndexCollection(columns = { @Index(name = "street") })
  4. public class AddressUM1

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

  1. @IndexCollection(columns = { @Index(name = "field")})
  2. public class EmbeddableEntity

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

  1. @IndexCollection(columns = { @Index(name = "currentLocation", type = "GEO2D"),
  2. @Index(name = "previousLocation", type = "GEO2D") })
  3. public class Vehicle

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

  1. @Embeddable
  2. @IndexCollection(columns={@Index(name="tyreId")})
  3. public class CarTyre

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

  1. @Entity
  2. @Table(name = "AddressCouchMTO", schema = "couchdatabase@couchdb_pu")
  3. @IndexCollection(columns = { @Index(name = "street") })
  4. public class AddressCouchMTO

相关文章