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


Java PersistenceBroker.delete方法代码示例

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


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

示例1: performDeletion

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * Have to be performed after the "normal" objects be written
 * to DB and before method {@link #performInsert()}.
 */
public void performDeletion()
{
    if(deletionMap == null)
        return;
    else
    {
        PersistenceBroker broker = tx.getBroker();
        Iterator it = deletionMap.values().iterator();
        while(it.hasNext())
        {
            NamedEntry namedEntry = (NamedEntry) it.next();
            broker.delete(namedEntry);
        }
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:20,代码来源:NamedRootsMap.java

示例2: afterStore

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * @see org.apache.ojb.broker.ManageableCollection#afterStore(PersistenceBroker broker)
 */
public void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
{
    // make sure allObjectsToBeRemoved does not contain
    // any instances that got re-added to the list
    allObjectsToBeRemoved.removeAll(this);

    Iterator iter = allObjectsToBeRemoved.iterator();
    while (iter.hasNext())
    {
        Object obj = iter.next();
        ClassDescriptor cld = broker.getClassDescriptor(obj.getClass());
        if (broker.serviceBrokerHelper().assertValidPkForDelete(cld, obj))
        {    
            broker.delete(obj);
        }    
    }
    allObjectsToBeRemoved.clear();
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:22,代码来源:RemovalAwareCollection.java

示例3: deleteArticlesStress

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * A resource cumbering delete-method implementation,
 * used to test implementation
 */
public void deleteArticlesStress(PerfArticle[] arr) throws Exception
{
    for (int i = 0; i < arr.length; i++)
    {
        PersistenceBroker broker = null;
        try
        {
            broker = PersistenceBrokerFactory.defaultPersistenceBroker();
            broker.beginTransaction();
            broker.delete(arr[i]);
            broker.commitTransaction();
        }
        finally
        {
            if (broker != null) broker.close();
        }
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:23,代码来源:OJBPerfTest.java

示例4: deleteArticles

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * A performance optimized delete-method implementation,
 * used to test performance
 */
public void deleteArticles(PerfArticle[] arr) throws Exception
{
    PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
    try
    {
        broker.serviceConnectionManager().setBatchMode(true);
        broker.beginTransaction();
        for (int i = 0; i < arr.length; i++)
        {
            broker.delete(arr[i]);
        }
        broker.commitTransaction();
    }
    finally
    {
        if (broker != null) broker.close();
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:23,代码来源:OJBPerfTest.java

示例5: afterStore

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * @see org.apache.ojb.broker.ManageableCollection#afterStore(PersistenceBroker broker)
 */
public void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
{
    // make sure allObjectsToBeRemoved does not contain
    // any instances that got re-added to the list
    allObjectsToBeRemoved.removeAll(this);

    Iterator iter = allObjectsToBeRemoved.iterator();
    while (iter.hasNext())
    {
        broker.delete(iter.next());
    }
    allObjectsToBeRemoved.clear();
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:17,代码来源:RemovalAwareSet.java

示例6: deleteObjects

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
protected void deleteObjects(PersistenceBroker broker, List objects)
{
    for (Iterator it = objects.iterator(); it.hasNext();)
    {
        broker.delete(it.next());
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:8,代码来源:PBSessionBean.java

示例7: deleteObject

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
 * Delete an object.
 */
public void deleteObject(Object object)
{
    PersistenceBroker broker = null;
    try
    {
        broker = getBroker();
        broker.delete(object);
    }
    finally
    {
        if (broker != null) broker.close();
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:17,代码来源:PBBaseBeanImpl.java

示例8: deleteObjects

import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
protected void deleteObjects(PersistenceBroker broker, Collection objects)
{
    for (Iterator it = objects.iterator(); it.hasNext();)
    {
        broker.delete(it.next());
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:8,代码来源:PBBaseBeanImpl.java


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