Package com.impetus.kundera.index

Examples of com.impetus.kundera.index.IndexCollection


        {
            metadata.setIndexName(clazz.getSimpleName());
        }
        Index idx = clazz.getAnnotation(Index.class);

        IndexCollection indexes = clazz.getAnnotation(IndexCollection.class);

        EntityType entityType = (EntityType) kunderaMetadata.getApplicationMetadata()
                .getMetaModelBuilder(metadata.getPersistenceUnit()).getManagedTypes().get(clazz);

        List<String> columnsNameToBeIndexed = new ArrayList<String>();

        Map<String, com.impetus.kundera.index.Index> indexedColumnsMap = new HashMap<String, com.impetus.kundera.index.Index>();

        if (null != indexes)
        {
            if (indexes.columns() != null && indexes.columns().length != 0)
            {
                metadata.setIndexable(true);
                for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
                {
                    if (indexedColumn.type().equals("composite"))
                    {
                        // means comma seperated list of columns
                        metadata.addIndexProperty(
View Full Code Here


     */
    public static Map<String, PropertyIndex> getIndexesOnEmbeddable(Class<?> entityClazz)
    {
        Map<String, PropertyIndex> pis = new HashMap<String, PropertyIndex>();
        Index idx = entityClazz.getAnnotation(Index.class);
        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);
                }
            }
        }
View Full Code Here

    public static boolean isEmbeddedAtributeIndexable(Field embeddedField)
    {
        Class<?> embeddableClass = PropertyAccessorHelper.getGenericClass(embeddedField);
        Index indexAnn = embeddableClass.getAnnotation(Index.class);
        IndexCollection indexCollection = embeddableClass.getAnnotation(IndexCollection.class);
        if (indexCollection != null && indexCollection.columns() != null)
        {
            return true;
        }
        else if (indexAnn != null)
        {
View Full Code Here

    public static boolean isColumnInEmbeddableIndexable(Field embeddedField, String columnFieldName)
    {
        Class<?> embeddableClass = PropertyAccessorHelper.getGenericClass(embeddedField);
        Index indexAnn = embeddableClass.getAnnotation(Index.class);
        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;
View Full Code Here

TOP

Related Classes of com.impetus.kundera.index.IndexCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.