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


Java PersistenceBroker.getTopLevelClass方法代码示例

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


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

示例1: getElementsExtentClass

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
private Class getElementsExtentClass(PersistenceBroker broker) throws PersistenceBrokerException
{
    // we ll have to compute the most general extent class here !!!
    DListEntry entry = (DListEntry) elements.get(0);
    Class elementsClass = entry.getRealSubject().getClass();
    Class extentClass = broker.getTopLevelClass(elementsClass);
    return extentClass;
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:9,代码来源:DSetImpl.java

示例2: getElementsExtentClass

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
private Class getElementsExtentClass(PersistenceBroker brokerForClass) throws PersistenceBrokerException
{
    // we ll have to compute the most general extent class here !!!
    DListEntry entry = (DListEntry) elements.get(0);
    Class elementsClass = entry.getRealSubject().getClass();
    Class extentClass = brokerForClass.getTopLevelClass(elementsClass);
    return extentClass;
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:9,代码来源:DListImpl.java

示例3: associateBatched

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * Associate the batched Children with their owner object.
 * Loop over owners
 */
protected void associateBatched(Collection owners, Collection children)
{
    ObjectReferenceDescriptor ord = getObjectReferenceDescriptor();
    ClassDescriptor cld = getOwnerClassDescriptor();
    Object owner;
    Object relatedObject;
    Object fkValues[];
    Identity id;
    PersistenceBroker pb = getBroker();
    PersistentField field = ord.getPersistentField();
    Class topLevelClass = pb.getTopLevelClass(ord.getItemClass());
    HashMap childrenMap = new HashMap(children.size());


    for (Iterator it = children.iterator(); it.hasNext(); )
    {
        relatedObject = it.next();
        childrenMap.put(pb.serviceIdentity().buildIdentity(relatedObject), relatedObject);
    }

    for (Iterator it = owners.iterator(); it.hasNext(); )
    {
        owner = it.next();
        fkValues = ord.getForeignKeyValues(owner,cld);
        if (isNull(fkValues))
        {
            field.set(owner, null);
            continue;
        }
        id = pb.serviceIdentity().buildIdentity(null, topLevelClass, fkValues);
        relatedObject = childrenMap.get(id);
        field.set(owner, relatedObject);
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:39,代码来源:ReferencePrefetcher.java

示例4: getMaxForExtent

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * Lookup all tables associated with given class (search all extent classes)
 * to find the current maximum value for the given field.
 * <br><b>Note:</b> Only works for <code>long</code> autoincrement fields.
 * @param brokerForClass persistence broker instance match the database of the
 * given field/class
 * @param field the target field
 */
public static long getMaxForExtent(PersistenceBroker brokerForClass, FieldDescriptor field) throws PersistenceBrokerException
{
    if (field == null)
    {
        log.error("Given FieldDescriptor was null, could not detect max value across all extents");
        return 0;
        // throw new PersistenceBrokerException("Given FieldDescriptor was null");
    }
    // first lookup top-level class
    Class topLevel = brokerForClass.getTopLevelClass(field.getClassDescriptor().getClassOfObject());
    return getMaxId(brokerForClass, topLevel, field);
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:21,代码来源:SequenceManagerHelper.java


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