本文整理汇总了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);
}
}
}
示例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();
}
示例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();
}
}
}
示例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();
}
}
示例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();
}
示例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());
}
}
示例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();
}
}
示例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());
}
}