Examples of GSAItemDescriptor


Examples of atg.adapter.gsa.GSAItemDescriptor

            pDatabaseName = getDatabaseName();
        }

        String[] descriptorNames = getWrappedRepository().getItemDescriptorNames();
        OutputSQLContext sqlContext = new OutputSQLContext(pOut);
        GSAItemDescriptor itemDescriptors[];
        //DatabaseTableInfo dti = getDatabaseTableInfo(pDatabaseName);
        int i, length = descriptorNames.length;

        itemDescriptors = new GSAItemDescriptor[length];
        for ( i = 0; i < length; i++ ) {
            itemDescriptors[i] = (GSAItemDescriptor) getWrappedRepository().getItemDescriptor(
                    descriptorNames[i]
            );
        }

        String create = null;
        String index = null;
        HashSet<String> tableNames = new HashSet<String>();
        for ( i = 0; i < length; i++ ) {
            GSAItemDescriptor desc = itemDescriptors[i];
            Table[] tables = desc.getTables();
            if ( tables != null ) {
                for ( Table t : tables ) {
                    if ( !t.isInherited() && !tableNames.contains(t.getName()) ) {
                        sqlContext.clear();
                        create = t.generateSQL(sqlContext, pDatabaseName);
View Full Code Here

Examples of atg.adapter.gsa.GSAItemDescriptor

            mDatabase.setName(pRepository.getAbsoluteName());
            mDatabase.setVersion("1.0");
        }
        String[] names = pRepository.getItemDescriptorNames();
        for ( String name : names ) {
            GSAItemDescriptor desc = (GSAItemDescriptor) pRepository.getItemDescriptor(name);
            Table[] tables = desc.getTables();
            // first do primary tables
            processTables(pRepository, tables, true);
        }
        for ( String name : names ) {
            GSAItemDescriptor desc = (GSAItemDescriptor) pRepository.getItemDescriptor(name);
            Table[] tables = desc.getTables();
            // then do the rest
            desc.getPrimaryTable();
            processTables(pRepository, tables, false);
        }

    }
View Full Code Here

Examples of atg.adapter.gsa.GSAItemDescriptor

     */
    protected MutableRepositoryItem createDummyItem(GSARepository pGSARepository,
                                                    String descName,
                                                    String pID)
            throws RepositoryException {
        GSAItemDescriptor descriptor = (GSAItemDescriptor) pGSARepository.getItemDescriptor(descName);
        MutableRepositoryItem item = null;
        boolean compoundPrimaryKey = descriptor.getPrimaryTable().getIdColumnCount() > 1;
        if ( pID == null || pID.trim().length() == 0 ) {
            if ( compoundPrimaryKey ) {
                item = pGSARepository.createItem(
                        getNewCompoundId(pGSARepository, descriptor), descName
                );
            } else {
                item = pGSARepository.createItem(descName);
            }
        } else {
            item = pGSARepository.createItem(pID, descName);
        }
        RepositoryPropertyDescriptor[] propDescriptors = (RepositoryPropertyDescriptor[]) descriptor
                .getPropertyDescriptors();
        for ( RepositoryPropertyDescriptor propertyDescriptor : propDescriptors ) {
            if ( propertyDescriptor.isWritable()
                 && !propertyDescriptor.isIdProperty()
                 && propertyDescriptor.isRequired() ) {
View Full Code Here

Examples of atg.adapter.gsa.GSAItemDescriptor

            pDatabaseName = getDatabaseName();
        }

        String[] descriptorNames = getItemDescriptorNames();
        OutputSQLContext sqlContext = new OutputSQLContext(pOut);
        GSAItemDescriptor itemDescriptors[];
        DatabaseTableInfo dti = getDatabaseTableInfo(pDatabaseName);
        int i, length = descriptorNames.length;

        itemDescriptors = new GSAItemDescriptor[length];
        for (i = 0; i < length; i++) {
            itemDescriptors[i] = (GSAItemDescriptor) getItemDescriptor(descriptorNames[i]);
        }

        String create = null;
        String index = null;
        for (i = 0; i < length; i++) {
            GSAItemDescriptor desc = itemDescriptors[i];
            Table[] tables = desc.getTables();
            if (tables != null) {
                for (Table t : tables) {
                    if (!t.isInherited()) {
                        sqlContext.clear();
                        create = t.generateSQL(sqlContext, pDatabaseName);
View Full Code Here

Examples of atg.adapter.gsa.GSAItemDescriptor

    public String[] getTableNames(GSARepository pRepository)
            throws Exception {
        ArrayList<String> names = new ArrayList<String>();
        String[] descriptorNames = pRepository.getItemDescriptorNames();

        GSAItemDescriptor itemDescriptors[];

        int i, length = descriptorNames.length;

        itemDescriptors = new GSAItemDescriptor[length];
        for (i = 0; i < length; i++) {
            itemDescriptors[i] = (GSAItemDescriptor) pRepository.getItemDescriptor(descriptorNames[i]);
        }

        //  String create = null;
        //   String index = null;
        for (i = 0; i < length; i++) {
            GSAItemDescriptor desc = itemDescriptors[i];
            Table[] tables = desc.getTables();
            if (tables != null) {
                for (Table table : tables) {
                    names.add(table.getName());
                }
            }
View Full Code Here

Examples of atg.adapter.gsa.GSAItemDescriptor

     * @param repository
     * @param itemDescriptorName
     */
    public static void dumpTables(GSARepository repository, String itemDescriptorName)
            throws RepositoryException, SQLException {
        GSAItemDescriptor itemDescriptor = (GSAItemDescriptor) repository.getItemDescriptor(
                itemDescriptorName
        );
        Set<String> doneTables = new HashSet<String>();
        for (Table table : itemDescriptor.getTables()) {
            if (!doneTables.contains(table.getName())) {
                dumpTable(table, new ArrayList<String>());
                doneTables.add(table.getName());
            }
        }
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.