Package org.hibernate.event.spi
Class EventType<T>
- java.lang.Object
-
- org.hibernate.event.spi.EventType<T>
-
public final class EventType<T> extends Object
Enumeration of the recognized types of events, including meta-information about each.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class
baseListenerInterface()
static <T> EventType<T>
create(String name, Class<T> listenerRole, int ordinal)
String
eventName()
boolean
isStandardEvent()
Is this event-type one of the standard event-types?int
ordinal()
EventType is effectively an enumeration.static EventType<?>
resolveEventTypeByName(String eventName)
Find anEventType
by its nameString
toString()
static Collection<EventType<?>>
values()
Get a collection of all the standardEventType
instances.
-
-
-
Field Detail
-
LOAD
public static final EventType<LoadEventListener> LOAD
-
RESOLVE_NATURAL_ID
public static final EventType<ResolveNaturalIdEventListener> RESOLVE_NATURAL_ID
-
INIT_COLLECTION
public static final EventType<InitializeCollectionEventListener> INIT_COLLECTION
-
SAVE_UPDATE
public static final EventType<SaveOrUpdateEventListener> SAVE_UPDATE
-
UPDATE
public static final EventType<SaveOrUpdateEventListener> UPDATE
-
SAVE
public static final EventType<SaveOrUpdateEventListener> SAVE
-
PERSIST
public static final EventType<PersistEventListener> PERSIST
-
PERSIST_ONFLUSH
public static final EventType<PersistEventListener> PERSIST_ONFLUSH
-
MERGE
public static final EventType<MergeEventListener> MERGE
-
DELETE
public static final EventType<DeleteEventListener> DELETE
-
REPLICATE
public static final EventType<ReplicateEventListener> REPLICATE
-
FLUSH
public static final EventType<FlushEventListener> FLUSH
-
AUTO_FLUSH
public static final EventType<AutoFlushEventListener> AUTO_FLUSH
-
DIRTY_CHECK
public static final EventType<DirtyCheckEventListener> DIRTY_CHECK
-
FLUSH_ENTITY
public static final EventType<FlushEntityEventListener> FLUSH_ENTITY
-
CLEAR
public static final EventType<ClearEventListener> CLEAR
-
EVICT
public static final EventType<EvictEventListener> EVICT
-
LOCK
public static final EventType<LockEventListener> LOCK
-
REFRESH
public static final EventType<RefreshEventListener> REFRESH
-
PRE_LOAD
public static final EventType<PreLoadEventListener> PRE_LOAD
-
PRE_DELETE
public static final EventType<PreDeleteEventListener> PRE_DELETE
-
PRE_UPDATE
public static final EventType<PreUpdateEventListener> PRE_UPDATE
-
PRE_INSERT
public static final EventType<PreInsertEventListener> PRE_INSERT
-
POST_LOAD
public static final EventType<PostLoadEventListener> POST_LOAD
-
POST_DELETE
public static final EventType<PostDeleteEventListener> POST_DELETE
-
POST_UPDATE
public static final EventType<PostUpdateEventListener> POST_UPDATE
-
POST_INSERT
public static final EventType<PostInsertEventListener> POST_INSERT
-
POST_COMMIT_DELETE
public static final EventType<PostDeleteEventListener> POST_COMMIT_DELETE
-
POST_COMMIT_UPDATE
public static final EventType<PostUpdateEventListener> POST_COMMIT_UPDATE
-
POST_COMMIT_INSERT
public static final EventType<PostInsertEventListener> POST_COMMIT_INSERT
-
PRE_COLLECTION_RECREATE
public static final EventType<PreCollectionRecreateEventListener> PRE_COLLECTION_RECREATE
-
PRE_COLLECTION_REMOVE
public static final EventType<PreCollectionRemoveEventListener> PRE_COLLECTION_REMOVE
-
PRE_COLLECTION_UPDATE
public static final EventType<PreCollectionUpdateEventListener> PRE_COLLECTION_UPDATE
-
POST_COLLECTION_RECREATE
public static final EventType<PostCollectionRecreateEventListener> POST_COLLECTION_RECREATE
-
POST_COLLECTION_REMOVE
public static final EventType<PostCollectionRemoveEventListener> POST_COLLECTION_REMOVE
-
POST_COLLECTION_UPDATE
public static final EventType<PostCollectionUpdateEventListener> POST_COLLECTION_UPDATE
-
-
Method Detail
-
resolveEventTypeByName
public static EventType<?> resolveEventTypeByName(String eventName)
Find anEventType
by its name- Parameters:
eventName
- The name- Returns:
- The
EventType
instance. - Throws:
HibernateException
- If eventName is null, or if eventName does not correlate to any known event type.
-
values
public static Collection<EventType<?>> values()
Get a collection of all the standardEventType
instances.
-
eventName
public String eventName()
-
baseListenerInterface
public Class baseListenerInterface()
-
ordinal
public int ordinal()
EventType is effectively an enumeration. Since there is a known, limited number of possible types, we expose an ordinal for each in order to be able to efficiently do associations elsewhere in the codebase (array vs. Map) For the total number of types, seevalues()
- Returns:
- A unique ordinal for this
EventType
, starting at 0 and up to the number of distinct events
-
isStandardEvent
public boolean isStandardEvent()
Is this event-type one of the standard event-types?
-
-