本文整理汇总了Java中org.hibernate.event.spi.PostUpdateEvent类的典型用法代码示例。如果您正苦于以下问题:Java PostUpdateEvent类的具体用法?Java PostUpdateEvent怎么用?Java PostUpdateEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostUpdateEvent类属于org.hibernate.event.spi包,在下文中一共展示了PostUpdateEvent类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: postUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
private void postUpdate() {
final EventListenerGroup<PostUpdateEventListener> listenerGroup = listenerGroup( EventType.POST_UPDATE );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostUpdateEvent event = new PostUpdateEvent(
getInstance(),
getId(),
state,
previousState,
dirtyFields,
getPersister(),
eventSource()
);
for ( PostUpdateEventListener listener : listenerGroup.listeners() ) {
listener.onPostUpdate( event );
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:EntityUpdateAction.java
示例2: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(PostUpdateEvent 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 updated");
} else if (entity instanceof Asset) {
Asset asset = (Asset) entity;
repository = asset.getRepository();
logger.debug("Repository statistics is outdated because asset is updated");
}
setRepositoryStatistisOutOfDate(repository);
}
开发者ID:box,项目名称:mojito,代码行数:18,代码来源:EntityCrudEventListener.java
示例3: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(PostUpdateEvent event) {
if ( disabled ) {
return;
}
final Object entity = event.getEntity();
final AbstractDocumentBuilder docBuilder = getDocumentBuilder( entity );
if ( docBuilder != null && (skipDirtyChecks || docBuilder.isDirty(
getDirtyPropertyNames(
event
)
)) ) {
Serializable id = event.getId();
processWork( entity, id, WorkType.UPDATE, event, false );
}
}
开发者ID:Hotware,项目名称:Hibernate-Search-GenericJPA,代码行数:18,代码来源:HibernateUpdateSource.java
示例4: postCommitUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
private void postCommitUpdate(boolean success) {
final EventListenerGroup<PostUpdateEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_UPDATE );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostUpdateEvent event = new PostUpdateEvent(
getInstance(),
getId(),
state,
previousState,
dirtyFields,
getPersister(),
eventSource()
);
for ( PostUpdateEventListener listener : listenerGroup.listeners() ) {
if ( PostCommitUpdateEventListener.class.isInstance( listener ) ) {
if ( success ) {
listener.onPostUpdate( event );
}
else {
((PostCommitUpdateEventListener) listener).onPostUpdateCommitFailed( event );
}
}
else {
//default to the legacy implementation that always fires the event
listener.onPostUpdate( event );
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:EntityUpdateAction.java
示例5: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
@Async
@Transactional(Transactional.TxType.REQUIRES_NEW) // Make sure any JPA queries run in this method don't try and use the same session that triggered this event listener method
public void onPostUpdate(PostUpdateEvent event) {
LOG.info("hibernate post update on object: " + event.getEntity());
List<Webhook> hooks = webhookManager.retrieveWebhooksByEntityNameAndEventType(event.getEntity().getClass().getSimpleName(), EventType.POST_UPDATE.eventName());
// Webhooks that do not specify a property list will be informed of ANY update to the entity
// Webhooks that specify a property list will only be informed if any of the properties defined have been updated.
hooks.stream()
.filter(wh -> wh.getPropertyList().isEmpty() || wh.getPropertyList().stream().anyMatch(propertyName -> isFieldModified(propertyName, event)))
.forEach(wh -> webhookProcessor.notifyWebhook(wh, event.getEntity()));
}
开发者ID:jfillo,项目名称:spring-data-rest-webhook,代码行数:13,代码来源:WebhookPostUpdateEventListener.java
示例6: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(PostUpdateEvent event) {
String entityName = event.getPersister().getEntityName();
if (!Context.internalRequestScope().isAuditedByEnvers()) {
log.debug(entityName + " NOT audited by Cibet configuration");
return;
} else {
log.debug(entityName + " audited by Cibet configuration");
}
super.onPostUpdate(event);
}
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:12,代码来源:CibetPostUpdateEventListener.java
示例7: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(PostUpdateEvent 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.rePublishRecord(records.getRdf(),records.getRdfAbout(),records.getHost());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
开发者ID:regestaexe,项目名称:bygle-ldp,代码行数:16,代码来源:DBEventUpdateListener.java
示例8: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(PostUpdateEvent pue) {
autowired();
EntityMode entityMode = pue.getPersister().getEntityMode();
RuleContext ruleContext = new RuleContextImplNoPrincipal(pue.getEntity(), getOriginalEntity(pue.getOldState(), pue.getPersister()));
fireRules(ruleContext, pue.getPersister(), pue.getState(), entityMode, RuleGroupPredefined.PostUpdate.class, RuleGroupPredefined.PostInsertOrUpdate.class, RuleGroupPredefined.PostUpdateOrDelete.class, RuleGroupPredefined.PostInsertOrUpdateOrDelete.class);
}
开发者ID:ix3,项目名称:ix3,代码行数:10,代码来源:EventListenerImplRuleEngine.java
示例9: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(PostUpdateEvent event) {
evictCache( event.getEntity(), event.getPersister(), event.getSession(), event.getOldState() );
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:CollectionCacheInvalidator.java
示例10: isFieldModified
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
private static boolean isFieldModified(String fieldName, PostUpdateEvent event) {
Integer propertyIndex = event.getPersister().getEntityMetamodel().getPropertyIndexOrNull(fieldName);
List<Integer> dirtyPropertyIndexes = Arrays.stream(event.getDirtyProperties()).boxed().collect(Collectors.toList());
return dirtyPropertyIndexes.stream().anyMatch(dirtyPropertyIndex -> Objects.equals(dirtyPropertyIndex, propertyIndex));
}
开发者ID:jfillo,项目名称:spring-data-rest-webhook,代码行数:6,代码来源:WebhookPostUpdateEventListener.java
示例11: onPostUpdateCommitFailed
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdateCommitFailed(PostUpdateEvent pue) {
}
开发者ID:box,项目名称:mojito,代码行数:4,代码来源:EntityCrudEventListener.java
示例12: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(PostUpdateEvent event) {
AuditManager.getInstance().audit(new EventBuilder()
.addAction("update " + event.getEntity().getClass().toString())
.addField(event.getEntity().getClass().toString(), event.getEntity()).build());
}
开发者ID:nipunthathsara,项目名称:Audit4j-Hibernate,代码行数:7,代码来源:AuditPostUpdateEventListenerImpl.java
示例13: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate( PostUpdateEvent event )
{
updateIdentifiableObjects();
}
开发者ID:ehatle,项目名称:AgileAlligators,代码行数:6,代码来源:HibernateEventListenerWiring.java
示例14: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
/**
* @see org.hibernate.event.spi.PostUpdateEventListener#onPostUpdate(org.hibernate
* .event.spi.PostUpdateEvent)
*/
@Override
public void onPostUpdate(PostUpdateEvent event) {
execute(postUpdate, event.getEntity());
}
开发者ID:beargiles,项目名称:spring-entity-listener,代码行数:9,代码来源:HibernateEntityListenersAdapter.java
示例15: onPostUpdate
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdate(final PostUpdateEvent event) {
}
开发者ID:krotscheck,项目名称:jersey2-toolkit,代码行数:5,代码来源:HibernateSessionFactoryFactoryTest.java
示例16: onPostUpdateCommitFailed
import org.hibernate.event.spi.PostUpdateEvent; //导入依赖的package包/类
@Override
public void onPostUpdateCommitFailed(final PostUpdateEvent event) {
}
开发者ID:krotscheck,项目名称:jersey2-toolkit,代码行数:5,代码来源:HibernateSessionFactoryFactoryTest.java
注:本文中的org.hibernate.event.spi.PostUpdateEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论