Best code examples for Hibernate ORM DeleteEvent class (org.hibernate.event.spi.DeleteEvent)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM DeleteEvent class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM DeleteEvent examples from Open Source projects
This code example shows how to use the following methods: getEntityName, getObject, getSession
		return super.invokeDeleteLifecycle( session, entity, persister );
	} 
 
	@Override 
	protected void performDetachedEntityDeletionCheck(DeleteEvent event) {
		EventSource source = event.getSession();
		String entityName = event.getEntityName();
		EntityPersister persister = source.getEntityPersister( entityName, event.getObject() );
		Serializable id =  persister.getIdentifier( event.getObject(), source );
		entityName = entityName == null ? source.guessEntityName( event.getObject() ) : entityName; 
		throw new IllegalArgumentException("Removing a detached instance "+ entityName + "#" + id);
	} 
} 
Full Snippet Info
6
CodeRank