本文整理了Java中com.impetus.kundera.index.Index
类的一些代码示例,展示了Index
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index
类的具体详情如下:
包路径:com.impetus.kundera.index.Index
类名称:Index
暂无
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "USER")
@IndexCollection(columns = { @Index(name = "name"), @Index(name = "age") })
public class UserInformation
代码示例来源: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
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
/**
* 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
@Entity
@Table(name = "UserInformation")
@IndexCollection(columns = { @Index(name = "name"), @Index(name = "age") })
public class UserInformation
代码示例来源:origin: Impetus/Kundera
for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
if (indexedColumn.type().equals("composite"))
prepareCompositeIndexName(indexedColumn.name(), entityType, metadata),
populatePropertyIndex(indexedColumn.indexName(), indexedColumn.type(), null, null, null));
indexedColumnsMap.put(indexedColumn.name(), indexedColumn);
String indexName = StringUtils.isBlank(indexedColumn.indexName()) ? columnName : indexedColumn
.indexName();
metadata.addIndexProperty(
columnName,
populatePropertyIndex(indexName, indexedColumn.type(), indexedColumn.max(),
indexedColumn.min(), (Field) attrib.getJavaMember()));
代码示例来源: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
@Embeddable
@IndexCollection(columns = { @Index(name = "tweetDate"), @Index(name = "firstName") })
public class CompositeUser
代码示例来源:origin: Impetus/Kundera
@Embeddable
@IndexCollection(columns = { @Index(name = "currentLocation", type = "GEO2D", min = -100, max = 500),
@Index(name = "previousLocation", type = "GEO2D", min = 100, max = 400) })
public class Location
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "ADDRESS", schema = "TESTDB")
@IndexCollection(columns = { @Index(name = "street") })
public class AddressRDBMSOTM
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "ADDRESS", schema = "TESTDB")
@IndexCollection(columns = { @Index(name = "street") })
public class AddressRDBMSMTO
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "ADDRESS", schema = "KunderaTests@patest")
@IndexCollection(columns = { @Index(name = "street") })
public class AddressU1M
代码示例来源:origin: Impetus/Kundera
@Embeddable
@IndexCollection(columns={@Index(name="engineId")})
public class CarEngine
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "AddressCouchOTM", schema = "couchdatabase@couchdb_pu")
@IndexCollection(columns = { @Index(name = "street") })
public class AddressCouchOTM
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "AddressMongoMTO", schema = "KunderaExamples@mongoTest")
@IndexCollection(columns = { @Index(name = "street") })
public class AddressMongoMTO
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "ADDRESS", schema = "KunderaTests@patest")
@IndexCollection(columns = { @Index(name = "street") })
public class AddressUM1
代码示例来源:origin: Impetus/Kundera
@IndexCollection(columns = { @Index(name = "field")})
public class EmbeddableEntity
代码示例来源:origin: Impetus/Kundera
@IndexCollection(columns = { @Index(name = "currentLocation", type = "GEO2D"),
@Index(name = "previousLocation", type = "GEO2D") })
public class Vehicle
代码示例来源:origin: Impetus/Kundera
@Embeddable
@IndexCollection(columns={@Index(name="tyreId")})
public class CarTyre
代码示例来源:origin: Impetus/Kundera
@Entity
@Table(name = "AddressCouchMTO", schema = "couchdatabase@couchdb_pu")
@IndexCollection(columns = { @Index(name = "street") })
public class AddressCouchMTO
内容来源于网络,如有侵权,请联系作者删除!