Examples of IndexDefinition


Examples of org.codehaus.aspectwerkz.extension.persistence.definition.IndexDefinition

        final List indexRefDefinitions = persistenceManagerDef.getIndexRefs();
        for (Iterator it = indexRefDefinitions.iterator(); it.hasNext();) {
            String indexName = ((IndexRefDefinition)it.next()).getName();
            List indexDefinitions = m_definition.getIndexes();
            for (Iterator it2 = indexDefinitions.iterator(); it2.hasNext();) {
                IndexDefinition indexDefinition = (IndexDefinition)it2.next();
                if (indexDefinition.getName().equals(indexName)) {
                    btreeIndexes.add(indexDefinition);
                }
            }
        }
        return btreeIndexes;
View Full Code Here

Examples of org.codehaus.aspectwerkz.extension.persistence.definition.IndexDefinition

        if (btreeIndexes == null) throw new IllegalArgumentException("index configurations can not be null");

        final List indexes = new ArrayList();
        for (Iterator it = btreeIndexes.iterator(); it.hasNext();) {

            final IndexDefinition indexDef = (IndexDefinition)it.next();
            final String jispIndexType = getJispIndexType(indexDef.getType());

            ObjectFactory factory = new DefaultObjectFactory(jispIndexType);

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_indexDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            File killit = new File(indexFile.toString());
            if (killit.exists()) killit.delete();

            final BTreeIndex index = new BTreeIndex(
                    indexFile.toString(),
                    INDEX_ORDER,
                    (KeyObject)factory.newInstance(),
                    false, m_loader);

            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
                    getJispIndexType(indexDef.getType()));

            m_jispIndexTypes.put(indexDef.getName(), indexType);
        }
        return indexes;
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.extension.persistence.definition.IndexDefinition

        final List indexes = new ArrayList();

        for (Iterator it = btreeIndexes.iterator(); it.hasNext();) {

            final IndexDefinition indexDef = (IndexDefinition)it.next();

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_databaseDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            final BTreeIndex index = new BTreeIndex(indexFile.toString(), m_loader);
            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
                    getJispIndexType(indexDef.getType()));

            m_jispIndexTypes.put(indexDef.getName(), indexType);
        }
        return indexes;
    }
View Full Code Here

Examples of org.eclipse.persistence.tools.schemaframework.IndexDefinition

    /**
     * INTERNAL:
     * Process the index metadata
     */
    public void process(MetadataDescriptor descriptor, String defaultColumnName) {
        IndexDefinition indexDefinition = new IndexDefinition();
       
        if (m_columnNames.isEmpty() && defaultColumnName != null) {
            indexDefinition.getFields().add(defaultColumnName);
        } else {
            indexDefinition.getFields().addAll(m_columnNames);
        }
       
        // Process the name value.
        if (m_name != null && m_name.length() != 0) {
            indexDefinition.setName(m_name);           
        } else {           
            String name = "INDEX_" + descriptor.getPrimaryTableName();
           
            for (String column : indexDefinition.getFields()) {
                name = name + "_" + column;
            }
           
            indexDefinition.setName(name);
        }
       
        // Process the schema value.
        if (m_schema != null && m_schema.length() != 0) {
            indexDefinition.setQualifier(m_schema);
        } else if (descriptor.getDefaultSchema() != null && descriptor.getDefaultSchema().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultSchema());               
        }
       
        // Process the catalog value.
        if (m_catalog != null && m_catalog.length() != 0) {
            indexDefinition.setQualifier(m_catalog);
        } else if (descriptor.getDefaultCatalog() != null && descriptor.getDefaultCatalog().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultCatalog());               
        }
       
        // Process the unique value.
        if (m_unique != null) {
            indexDefinition.setIsUnique(m_unique);
        }
       
        // Process table value.
        if (m_table == null || m_table.length() == 0) {
            indexDefinition.setTargetTable(descriptor.getPrimaryTable().getQualifiedName());
            descriptor.getPrimaryTable().getIndexes().add(indexDefinition);
        } else if (m_table.equals(descriptor.getPrimaryTable().getQualifiedName()) || m_table.equals(descriptor.getPrimaryTableName())) {
            indexDefinition.setTargetTable(m_table);
            descriptor.getPrimaryTable().getIndexes().add(indexDefinition);
        } else {
            indexDefinition.setTargetTable(m_table);
            boolean found = false;
            for (DatabaseTable databaseTable : descriptor.getClassDescriptor().getTables()) {
                if (m_table.equals(databaseTable.getQualifiedName()) || m_table.equals(databaseTable.getName())) {
                    databaseTable.getIndexes().add(indexDefinition);
                    found = true;
View Full Code Here

Examples of org.eclipse.persistence.tools.schemaframework.IndexDefinition

    /**
     * INTERNAL:
     * Process the index metadata
     */
    public void process(MetadataDescriptor descriptor, String defaultColumnName) {
        IndexDefinition indexDefinition = new IndexDefinition();
       
        if (m_columnNames.isEmpty() && defaultColumnName != null) {
            indexDefinition.getFields().add(defaultColumnName);
        } else {
            indexDefinition.getFields().addAll(m_columnNames);
        }
       
        // Process the name value.
        if (m_name != null && m_name.length() != 0) {
            indexDefinition.setName(m_name);           
        } else {           
            String name = "INDEX_" + descriptor.getPrimaryTableName();
           
            for (String column : indexDefinition.getFields()) {
                name = name + "_" + column;
            }
           
            indexDefinition.setName(name);
        }
       
        // Process the schema value.
        if (m_schema != null && m_schema.length() != 0) {
            indexDefinition.setQualifier(m_schema);
        } else if (descriptor.getDefaultSchema() != null && descriptor.getDefaultSchema().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultSchema());               
        }
       
        // Process the catalog value.
        if (m_catalog != null && m_catalog.length() != 0) {
            indexDefinition.setQualifier(m_catalog);
        } else if (descriptor.getDefaultCatalog() != null && descriptor.getDefaultCatalog().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultCatalog());               
        }
       
        // Process the unique value.
        if (m_unique != null) {
            indexDefinition.setIsUnique(m_unique);
        }
       
        // Process table value.
        if (m_table == null || m_table.length() == 0) {
            indexDefinition.setTargetTable(descriptor.getPrimaryTable().getQualifiedName());
            descriptor.getPrimaryTable().getIndexes().add(indexDefinition);
        } else if (m_table.equals(descriptor.getPrimaryTable().getQualifiedName()) || m_table.equals(descriptor.getPrimaryTableName())) {
            indexDefinition.setTargetTable(m_table);
            descriptor.getPrimaryTable().getIndexes().add(indexDefinition);
        } else {
            indexDefinition.setTargetTable(m_table);
            boolean found = false;
            for (DatabaseTable databaseTable : descriptor.getClassDescriptor().getTables()) {
                if (m_table.equals(databaseTable.getQualifiedName()) || m_table.equals(databaseTable.getName())) {
                    databaseTable.getIndexes().add(indexDefinition);
                    found = true;
View Full Code Here

Examples of org.eclipse.persistence.tools.schemaframework.IndexDefinition

     * INTERNAL:
     * Process the index metadata. This is called from all table metadata.
     * CollectionTable, SecondaryTable, JoinTable, Table, TableGenerator.
     */
    public void process(DatabaseTable table) {
        IndexDefinition indexDefinition = new IndexDefinition();
       
        // Process the column list (comma separated string)
        StringTokenizer st = new StringTokenizer(m_columnList, ",");
        while (st.hasMoreTokens()) {
            indexDefinition.addField(((String) st.nextToken()).trim());
        }
       
        // Process the name value.
        indexDefinition.setName(processName(table, indexDefinition));
       
        // Process the unique value.
        indexDefinition.setIsUnique(isUnique());
       
        // Add the index definition to the table provided.
        indexDefinition.setQualifier(table.getTableQualifier());
        indexDefinition.setTargetTable(table.getQualifiedName());
        table.addIndex(indexDefinition);
    }
View Full Code Here

Examples of org.eclipse.persistence.tools.schemaframework.IndexDefinition

     * INTERNAL:
     * Process the index metadata. This is called from EntityAccessor and
     * BasicAccesor (for Basic, Id and Version)
     */
    public void process(MetadataDescriptor descriptor, String defaultColumnName) {
        IndexDefinition indexDefinition = new IndexDefinition();
        DatabaseTable primaryTable = descriptor.getPrimaryTable();
       
        if (m_columnNames.isEmpty() && defaultColumnName != null) {
            indexDefinition.getFields().add(defaultColumnName);
        } else {
            indexDefinition.getFields().addAll(m_columnNames);
        }
       
        // Process the name value.
        indexDefinition.setName(processName(primaryTable, indexDefinition));
       
        // Process the schema value.
        if (m_schema != null && m_schema.length() != 0) {
            indexDefinition.setQualifier(m_schema);
        } else if (descriptor.getDefaultSchema() != null && descriptor.getDefaultSchema().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultSchema());               
        }
       
        // Process the catalog value.
        if (m_catalog != null && m_catalog.length() != 0) {
            indexDefinition.setQualifier(m_catalog);
        } else if (descriptor.getDefaultCatalog() != null && descriptor.getDefaultCatalog().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultCatalog());               
        }
       
        // Process the unique value.
        indexDefinition.setIsUnique(isUnique());
       
        // Process table value.
        if (m_table == null || m_table.length() == 0) {
            indexDefinition.setTargetTable(primaryTable.getQualifiedName());
            primaryTable.addIndex(indexDefinition);
        } else if (m_table.equals(primaryTable.getQualifiedName()) || m_table.equals(primaryTable.getName())) {
            indexDefinition.setTargetTable(m_table);
            primaryTable.addIndex(indexDefinition);
        } else {
            indexDefinition.setTargetTable(m_table);
            boolean found = false;
            for (DatabaseTable databaseTable : descriptor.getClassDescriptor().getTables()) {
                if (m_table.equals(databaseTable.getQualifiedName()) || m_table.equals(databaseTable.getName())) {
                    databaseTable.addIndex(indexDefinition);
                    found = true;
View Full Code Here

Examples of org.eclipse.persistence.tools.schemaframework.IndexDefinition

    /**
     * INTERNAL:
     * Process the index metadata
     */
    public void process(MetadataDescriptor descriptor, String defaultColumnName) {
        IndexDefinition indexDefinition = new IndexDefinition();
       
        if (m_columnNames.isEmpty() && defaultColumnName != null) {
            indexDefinition.getFields().add(defaultColumnName);
        } else {
            indexDefinition.getFields().addAll(m_columnNames);
        }
       
        // Process the name value.
        if (m_name != null && m_name.length() != 0) {
            indexDefinition.setName(m_name);           
        } else {           
            String name = "INDEX_" + descriptor.getPrimaryTableName();
           
            for (String column : indexDefinition.getFields()) {
                name = name + "_" + column;
            }
           
            indexDefinition.setName(name);
        }
       
        // Process the schema value.
        if (m_schema != null && m_schema.length() != 0) {
            indexDefinition.setQualifier(m_schema);
        } else if (descriptor.getDefaultSchema() != null && descriptor.getDefaultSchema().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultSchema());               
        }
       
        // Process the catalog value.
        if (m_catalog != null && m_catalog.length() != 0) {
            indexDefinition.setQualifier(m_catalog);
        } else if (descriptor.getDefaultCatalog() != null && descriptor.getDefaultCatalog().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultCatalog());               
        }
       
        // Process the unique value.
        if (m_unique != null) {
            indexDefinition.setIsUnique(m_unique);
        }
       
        // Process table value.
        if (m_table == null || m_table.length() == 0) {
            indexDefinition.setTargetTable(descriptor.getPrimaryTable().getQualifiedName());
            descriptor.getPrimaryTable().getIndexes().add(indexDefinition);
        } else if (m_table.equals(descriptor.getPrimaryTable().getQualifiedName()) || m_table.equals(descriptor.getPrimaryTableName())) {
            indexDefinition.setTargetTable(m_table);
            descriptor.getPrimaryTable().getIndexes().add(indexDefinition);
        } else {
            indexDefinition.setTargetTable(m_table);
            boolean found = false;
            for (DatabaseTable databaseTable : descriptor.getClassDescriptor().getTables()) {
                if (m_table.equals(databaseTable.getQualifiedName()) || m_table.equals(databaseTable.getName())) {
                    databaseTable.getIndexes().add(indexDefinition);
                    found = true;
View Full Code Here

Examples of org.eclipse.persistence.tools.schemaframework.IndexDefinition

     * INTERNAL:
     * Process the index metadata. This is called from all table metadata.
     * CollectionTable, SecondaryTable, JoinTable, Table, TableGenerator.
     */
    public void process(DatabaseTable table) {
        IndexDefinition indexDefinition = new IndexDefinition();
       
        // Process the column list (comma separated string)
        StringTokenizer st = new StringTokenizer(m_columnList, ",");
        while (st.hasMoreTokens()) {
            indexDefinition.addField(((String) st.nextToken()).trim());
        }
       
        // Process the name value.
        indexDefinition.setName(processName(table, indexDefinition));
       
        // Process the unique value.
        indexDefinition.setIsUnique(isUnique());
       
        // Add the index definition to the table provided.
        indexDefinition.setQualifier(table.getTableQualifier());
        indexDefinition.setTargetTable(table.getQualifiedName());
        table.addIndex(indexDefinition);
    }
View Full Code Here

Examples of org.eclipse.persistence.tools.schemaframework.IndexDefinition

     * INTERNAL:
     * Process the index metadata. This is called from EntityAccessor and
     * BasicAccesor (for Basic, Id and Version)
     */
    public void process(MetadataDescriptor descriptor, String defaultColumnName) {
        IndexDefinition indexDefinition = new IndexDefinition();
        DatabaseTable primaryTable = descriptor.getPrimaryTable();
       
        if (m_columnNames.isEmpty() && defaultColumnName != null) {
            indexDefinition.getFields().add(defaultColumnName);
        } else {
            indexDefinition.getFields().addAll(m_columnNames);
        }
       
        // Process the name value.
        indexDefinition.setName(processName(primaryTable, indexDefinition));
       
        // Process the schema value.
        if (m_schema != null && m_schema.length() != 0) {
            indexDefinition.setQualifier(m_schema);
        } else if (descriptor.getDefaultSchema() != null && descriptor.getDefaultSchema().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultSchema());               
        }
       
        // Process the catalog value.
        if (m_catalog != null && m_catalog.length() != 0) {
            indexDefinition.setQualifier(m_catalog);
        } else if (descriptor.getDefaultCatalog() != null && descriptor.getDefaultCatalog().length() != 0) {
            indexDefinition.setQualifier(descriptor.getDefaultCatalog());               
        }
       
        // Process the unique value.
        indexDefinition.setIsUnique(isUnique());
       
        // Process table value.
        if (m_table == null || m_table.length() == 0) {
            indexDefinition.setTargetTable(primaryTable.getQualifiedName());
            primaryTable.addIndex(indexDefinition);
        } else if (m_table.equals(primaryTable.getQualifiedName()) || m_table.equals(primaryTable.getName())) {
            indexDefinition.setTargetTable(m_table);
            primaryTable.addIndex(indexDefinition);
        } else {
            indexDefinition.setTargetTable(m_table);
            boolean found = false;
            for (DatabaseTable databaseTable : descriptor.getClassDescriptor().getTables()) {
                if (m_table.equals(databaseTable.getQualifiedName()) || m_table.equals(databaseTable.getName())) {
                    databaseTable.addIndex(indexDefinition);
                    found = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.