当前位置: 首页>>代码示例>>Java>>正文


Java ClassDescriptor.isAbstract方法代码示例

本文整理汇总了Java中org.apache.ojb.broker.metadata.ClassDescriptor.isAbstract方法的典型用法代码示例。如果您正苦于以下问题:Java ClassDescriptor.isAbstract方法的具体用法?Java ClassDescriptor.isAbstract怎么用?Java ClassDescriptor.isAbstract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ojb.broker.metadata.ClassDescriptor的用法示例。


在下文中一共展示了ClassDescriptor.isAbstract方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildManyToManyReferences

import org.apache.ojb.broker.metadata.ClassDescriptor; //导入方法依赖的package包/类
private void buildManyToManyReferences(ClassDescriptor cd, CollectionDescriptor collectionDescriptor,
                                        Object keys[], Vector columns)
 {
     if(cd.isAbstract() || cd.isInterface())
     {
logger.debug( "Skip foreign key build for MtoM, found abstract base class or interface " + cd.getClassNameOfObject() );
         return;
     }
     StringBuffer buffer = new StringBuffer(256);
     buildForeignKeyHeader(cd.getFullTableName(), buffer);

     for (int i = 0; i < keys.length; i++) {
         String columnName = (String) keys[i];

         FieldDescriptor foreignColumn = cd.getPkFields()[i];
         String foreignColumnName = foreignColumn.getPersistentField().getName();
         buildReferenceForColumn(buffer, columnName, foreignColumnName);
         FieldDescriptor fieldDescriptor = (FieldDescriptor)foreignColumn.clone();
         fieldDescriptor.setColumnName(columnName);
         columns.add(fieldDescriptor);
     }
     buffer.append("        </foreign-key>\n");

     addReferenceToTable(collectionDescriptor.getIndirectionTable(), buffer.toString());
 }
 
开发者ID:KualiCo,项目名称:ojb,代码行数:26,代码来源:TorqueForeignKeyGenerator.java

示例2: buildConstraintsMap

import org.apache.ojb.broker.metadata.ClassDescriptor; //导入方法依赖的package包/类
public void buildConstraintsMap() {
    Iterator classDescriptorIterators = this.repository.iterator();
    while (classDescriptorIterators.hasNext()) {
        ClassDescriptor cd = (ClassDescriptor) classDescriptorIterators.next();
        if(cd.isAbstract() || cd.isInterface())
        {
logger.debug( "Skip constraint build for abstract class/ interface " + cd.getClassNameOfObject() );
        }
        else
        {
            buildConstraints(cd);
            buildOneToOneConstraints(cd);
        }
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:16,代码来源:TorqueForeignKeyGenerator.java

示例3: buildForeignKey

import org.apache.ojb.broker.metadata.ClassDescriptor; //导入方法依赖的package包/类
private void buildForeignKey(ClassDescriptor foreignClassDescriptor, Vector foreignKeyIndices, ClassDescriptor classDescriptor) {

        if(classDescriptor.isAbstract() || classDescriptor.isInterface())
        {
			logger.debug( "Skip foreign key build, found abstract base class or interface " + classDescriptor.getClassNameOfObject() );
            return;
        }
        StringBuffer buffer = new StringBuffer(256);
        buildForeignKeyHeader(foreignClassDescriptor.getFullTableName(), buffer);

        for (int i = 0; i < foreignKeyIndices.size(); i++) {
            String columnName = null;
            Object obj = foreignKeyIndices.get(i);

            if (obj instanceof Integer)
            {
                int foreignKeyIndex = ((Integer) obj).intValue();
                columnName = classDescriptor.getFieldDescriptorByIndex(foreignKeyIndex).getColumnName();
            }
            else
            {
                    FieldDescriptor fld = classDescriptor.getFieldDescriptorByName((String) obj);
                    if(fld == null)
                    {
						logger.debug( "FieldDescriptor for foreign key parameter \n" + obj + " was not found in ClassDescriptor \n" + classDescriptor );
                    }
                    else columnName = fld.getColumnName();
            }

            FieldDescriptor foreignColumn = foreignClassDescriptor.getPkFields()[i];
            String foreignColumnName = foreignColumn.getColumnName();
            buildReferenceForColumn(buffer, columnName, foreignColumnName);
        }
        buffer.append("        </foreign-key>\n");
        addReferenceToTable(classDescriptor.getFullTableName(), buffer.toString());
    }
 
开发者ID:KualiCo,项目名称:ojb,代码行数:37,代码来源:TorqueForeignKeyGenerator.java

示例4: buildStandardTables

import org.apache.ojb.broker.metadata.ClassDescriptor; //导入方法依赖的package包/类
public void buildStandardTables() {
    Iterator classDescriptorIterators = this.repository.iterator();
    while (classDescriptorIterators.hasNext()) {
        ClassDescriptor cd = (ClassDescriptor) classDescriptorIterators.next();
        if(cd.isAbstract() || cd.isInterface())
        {
            System.out.println("Skip table build for abstract base class / interface called "+cd.getClassNameOfObject());
        }
        else
        {
            buildStandardTable(cd);
        }
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:15,代码来源:TorqueTablePreprocessor.java

示例5: TableAlias

import org.apache.ojb.broker.metadata.ClassDescriptor; //导入方法依赖的package包/类
TableAlias(ClassDescriptor aCld, String anAlias, boolean lookForExtents, List hints)
     {
         this.cld = aCld;
         this.table = aCld.getFullTableName();
         this.alias = anAlias;
         boolean useHintsOnExtents = false;

         // BRJ: store alias map of in enclosing class
setTableAliasForClassDescriptor(aCld, this);

         //LEANDRO: use hints
         if (hints != null && hints.size() > 0)
         {
             useHintsOnExtents = true;
         }

         logger.debug("TableAlias(): using hints ? " + useHintsOnExtents);

         // BRJ : build alias for extents, only one per Table
         if (lookForExtents)
         {
             ClassDescriptor[] extCLDs = (ClassDescriptor[]) aCld.getRepository().getAllConcreteSubclassDescriptors(
                     aCld).toArray(new ClassDescriptor[0]);

             ClassDescriptor extCd;
             Class extClass;
             String extTable;
             Map extMap = new HashMap(); // only one Alias per Table
             int firstNonAbstractExtentIndex = 0;

             for (int i = 0; i < extCLDs.length; i++)
             {
                 extCd = extCLDs[i];
                 extClass = extCd.getClassOfObject();
                 if (useHintsOnExtents && (!hints.contains(extClass)))
                 {
                     //LEANDRO: don't include this class
                     logger.debug("Skipping class [" + extClass + "] from extents List");
                     firstNonAbstractExtentIndex++;
                     continue;
                 }
                 extTable = extCd.getFullTableName();

                 // BRJ : Use the first non abstract extent
                 // if the main cld is abstract
                 //logger.debug("cld abstract["+aCld.isAbstract()+"] i["+i+"] index ["+firtsNonAbstractExtentIndex+"]");
                 if (aCld.isAbstract() && i == firstNonAbstractExtentIndex)
                 {
                     this.cld = extCd;
                     this.table = extTable;
                 }
                 else
                 {
                     // Add a new extent entry only if the table of the extent
                     // does not match the table of the 'base' class.
                     if (extMap.get(extTable) == null && !extTable.equals(table))
                     {
                         extMap.put(extTable, new TableAlias(extCd, anAlias + "E" + i, false, hints));
                     }
                 }
             }
             extents.addAll(extMap.values());
         }

         if (cld == null)
         {
             throw new PersistenceBrokerSQLException("Table is NULL for alias: " + alias);
         }
     }
 
开发者ID:KualiCo,项目名称:ojb,代码行数:70,代码来源:SqlQueryStatement.java

示例6: getMaxId

import org.apache.ojb.broker.metadata.ClassDescriptor; //导入方法依赖的package包/类
/**
 * Search down all extent classes and return max of all found
 * PK values.
 */
public static long getMaxId(PersistenceBroker brokerForClass, Class topLevel, FieldDescriptor original) throws PersistenceBrokerException
{
    long max = 0;
    long tmp;
    ClassDescriptor cld = brokerForClass.getClassDescriptor(topLevel);

    // if class is not an interface / not abstract we have to search its directly mapped table
    if (!cld.isInterface() && !cld.isAbstract())
    {
        tmp = getMaxIdForClass(brokerForClass, cld, original);
        if (tmp > max)
        {
            max = tmp;
        }
    }
    // if class is an extent we have to search through its subclasses
    if (cld.isExtent())
    {
        Vector extentClasses = cld.getExtentClasses();
        for (int i = 0; i < extentClasses.size(); i++)
        {
            Class extentClass = (Class) extentClasses.get(i);
            if (cld.getClassOfObject().equals(extentClass))
            {
                throw new PersistenceBrokerException("Circular extent in " + extentClass +
                        ", please check the repository");
            }
            else
            {
                // fix by Mark Rowell
                // Call recursive
                tmp = getMaxId(brokerForClass, extentClass, original);
            }
            if (tmp > max)
            {
                max = tmp;
            }
        }
    }
    return max;
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:46,代码来源:SequenceManagerHelper.java


注:本文中的org.apache.ojb.broker.metadata.ClassDescriptor.isAbstract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。