本文整理汇总了Java中org.hibernate.event.spi.PostInsertEvent类的典型用法代码示例。如果您正苦于以下问题:Java PostInsertEvent类的具体用法?Java PostInsertEvent怎么用?Java PostInsertEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PostInsertEvent类属于org.hibernate.event.spi包,在下文中一共展示了PostInsertEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postInsert() {
final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_INSERT );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostInsertEvent event = new PostInsertEvent(
getInstance(),
getId(),
getState(),
getPersister(),
eventSource()
);
for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
listener.onPostInsert( event );
}
}
示例2: postInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postInsert() {
if ( isDelayed ) {
getSession().getPersistenceContext().replaceDelayedEntityIdentityInsertKeys( delayedEntityKey, generatedId );
}
final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_INSERT );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostInsertEvent event = new PostInsertEvent(
getInstance(),
generatedId,
getState(),
getPersister(),
eventSource()
);
for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
listener.onPostInsert( event );
}
}
示例3: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent 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 added");
} else if (entity instanceof TMTextUnitVariant) {
TMTextUnitVariant tmTextUnitVariant = (TMTextUnitVariant) entity;
TMTextUnit tmTextUnit = tmTextUnitVariant.getTmTextUnit();
repository = tmTextUnit.getAsset().getRepository();
logger.debug("Repository statistics is outdated because string/translation is added");
}
setRepositoryStatistisOutOfDate(repository);
}
示例4: postCommitInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postCommitInsert(boolean success) {
final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_INSERT );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostInsertEvent event = new PostInsertEvent(
getInstance(),
getId(),
getState(),
getPersister(),
eventSource()
);
for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
if ( PostCommitInsertEventListener.class.isInstance( listener ) ) {
if ( success ) {
listener.onPostInsert( event );
}
else {
((PostCommitInsertEventListener) listener).onPostInsertCommitFailed( event );
}
}
else {
//default to the legacy implementation that always fires the event
listener.onPostInsert( event );
}
}
}
示例5: postCommitInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postCommitInsert(boolean success) {
final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_INSERT );
if ( listenerGroup.isEmpty() ) {
return;
}
final PostInsertEvent event = new PostInsertEvent(
getInstance(),
generatedId,
getState(),
getPersister(),
eventSource()
);
for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
if ( PostCommitInsertEventListener.class.isInstance( listener ) ) {
if ( success ) {
listener.onPostInsert( event );
}
else {
((PostCommitInsertEventListener) listener).onPostInsertCommitFailed( event );
}
}
else {
//default to the legacy implementation that always fires the event
listener.onPostInsert( event );
}
}
}
示例6: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
// TODO
// Repository check, get from Audit annotation, get from entoity table
// name.
if (event.getEntity().getClass().isAnnotationPresent(Audit.class)) {
if (event.getEntity().getClass().isAnnotationPresent(Table.class)) {
}
AuditManager.getInstance().audit(new EventBuilder()
.addAction("save " + event.getEntity().getClass().toString())
.addField(event.getEntity().getClass().toString(), event.getEntity()).build());
}
}
示例7: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
public void onPostInsert(PostInsertEvent 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.onPostInsert(event);
}
示例8: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent 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.publishRecord(records.getRdf(), records.getRdfAbout(), records.getHost());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例9: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
if ( disabled ) {
return;
}
final Object entity = event.getEntity();
if ( getDocumentBuilder( entity ) != null ) {
Serializable id = event.getId();
processWork( entity, id, WorkType.ADD, event, false );
}
}
示例10: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
evictCache( event.getEntity(), event.getPersister(), event.getSession(), null );
}
示例11: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
audit(event, Creation, event.getEntity());
}
示例12: onPostInsertCommitFailed
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsertCommitFailed(PostInsertEvent pie) {
}
示例13: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
// Do Nothing
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:5,代码来源:EmptyEnversPostInsertEventListenerImpl.java
示例14: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert( PostInsertEvent event )
{
updateIdentifiableObjects();
}
示例15: onPostInsert
import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
/**
* @see org.hibernate.event.spi.PostInsertEventListener#onPostInsert(org.hibernate
* .event.spi.PostInsertEvent)
*/
@Override
public void onPostInsert(PostInsertEvent event) {
execute(postInsert, event.getEntity());
}