本文整理汇总了Java中org.hibernate.event.spi.PostDeleteEvent类的典型用法代码示例。如果您正苦于以下问题:Java PostDeleteEvent类的具体用法?Java PostDeleteEvent怎么用?Java PostDeleteEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostDeleteEvent类属于org.hibernate.event.spi包,在下文中一共展示了PostDeleteEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
private void postDelete() {
final EventListenerGroup<PostDeleteEventListener> listenerGroup = listenerGroup( EventType.POST_DELETE );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostDeleteEvent event = new PostDeleteEvent(
getInstance(),
getId(),
state,
getPersister(),
eventSource()
);
for ( PostDeleteEventListener listener : listenerGroup.listeners() ) {
listener.onPostDelete( event );
}
}
示例2: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent event) {
Repository repository = null;
Object entity = event.getEntity();
if (entity instanceof RepositoryLocale) {
RepositoryLocale repositoryLocale = (RepositoryLocale) entity;
repository = repositoryLocale.getRepository();
logger.debug("Repository statistics is outdated because locale is deleted");
} else if (entity instanceof TMTextUnitCurrentVariant) {
TMTextUnitCurrentVariant tmTextUnitCurrentVariant = (TMTextUnitCurrentVariant) entity;
repository = tmTextUnitCurrentVariant.getTmTextUnit().getAsset().getRepository();
logger.debug("Repository statistics is outdated because translation is deleted");
}
setRepositoryStatistisOutOfDate(repository);
}
示例3: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent event) {
if ( disabled ) {
return;
}
final Object entity = event.getEntity();
if ( getDocumentBuilder( entity ) != null ) {
// FIXME The engine currently needs to know about details such as identifierRollbackEnabled
// but we should not move the responsibility to figure out the proper id to the engine
boolean identifierRollbackEnabled = event.getSession()
.getFactory()
.getSettings()
.isIdentifierRollbackEnabled();
processWork(
entity,
event.getId(),
WorkType.DELETE,
event,
identifierRollbackEnabled
);
}
}
示例4: postCommitDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
private void postCommitDelete(boolean success) {
final EventListenerGroup<PostDeleteEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_DELETE );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostDeleteEvent event = new PostDeleteEvent(
getInstance(),
getId(),
state,
getPersister(),
eventSource()
);
for ( PostDeleteEventListener listener : listenerGroup.listeners() ) {
if ( PostCommitDeleteEventListener.class.isInstance( listener ) ) {
if ( success ) {
listener.onPostDelete( event );
}
else {
((PostCommitDeleteEventListener) listener).onPostDeleteCommitFailed( event );
}
}
else {
//default to the legacy implementation that always fires the event
listener.onPostDelete( event );
}
}
}
示例5: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent event) {
if (!Context.internalRequestScope().isAuditedByEnvers()) {
String entityName = event.getPersister().getEntityName();
log.debug(entityName + " not audited by Cibet configuration");
return;
}
super.onPostDelete(event);
}
示例6: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete( PostDeleteEvent event )
{
if ( MetadataObject.class.isInstance( event.getEntity() ) )
{
IdentifiableObject identifiableObject = (IdentifiableObject) event.getEntity();
DeletedObject deletedObject = new DeletedObject( identifiableObject );
deletedObject.setDeletedBy( getUsername() );
event.getSession().persist( deletedObject );
}
}
示例7: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent arg0) {
if(arg0.getEntity() instanceof Records){
Records records = (Records)arg0.getEntity();
try {
if(records.getRecordTypes().getIdRecordType()!=BygleSystemUtils.RESOURCE_TYPE_BINARY){
EndPointManagerInterface endPointManager = endPointManagerProvider.getEndPointManager();
endPointManager.dePublishRecord(records.getRdf(),records.getRdfAbout(),records.getHost());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例8: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent pde) {
autowired();
EntityMode entityMode = pde.getPersister().getEntityMode();
RuleContext ruleContext = new RuleContextImplNoPrincipal(pde.getEntity(), null);
fireRules(ruleContext, pde.getPersister(), null, entityMode, RuleGroupPredefined.PostDelete.class, RuleGroupPredefined.PostInsertOrUpdateOrDelete.class, RuleGroupPredefined.PostUpdateOrDelete.class);
}
示例9: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent event) {
evictCache( event.getEntity(), event.getPersister(), event.getSession(), null );
}
示例10: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent event) {
audit(event, Deletion, event.getEntity());
}
示例11: onPostDeleteCommitFailed
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDeleteCommitFailed(PostDeleteEvent pde) {
}
示例12: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(PostDeleteEvent event) {
AuditManager.getInstance().audit(new EventBuilder()
.addAction("delete " + event.getEntity().getClass().toString())
.addField(event.getEntity().getClass().toString(), event.getEntity()).build());
}
示例13: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete( PostDeleteEvent event )
{
updateIdentifiableObjects();
}
示例14: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
/**
* @see org.hibernate.event.spi.PostDeleteEventListener#onPostDelete(org.hibernate
* .event.spi.PostDeleteEvent)
*/
@Override
public void onPostDelete(PostDeleteEvent event) {
execute(postRemove, event.getEntity());
}
示例15: onPostDelete
import org.hibernate.event.spi.PostDeleteEvent; //导入依赖的package包/类
@Override
public void onPostDelete(final PostDeleteEvent event) {
}