Example usage for org.hibernate.event.spi PreInsertEvent getSession

List of usage examples for org.hibernate.event.spi PreInsertEvent getSession

Introduction

In this page you can find the example usage for org.hibernate.event.spi PreInsertEvent getSession.

Prototype

public final EventSource getSession() 

Source Link

Document

Returns the session event source for this event.

Usage

From source file:com.mpe.common.validation.BeanValidationEventListener.java

License:Open Source License

public boolean onPreInsert(PreInsertEvent event) {
    validate(event.getEntity(), event.getPersister().getEntityMode(), event.getPersister(),
            event.getSession().getFactory(), GroupsPerOperation.Operation.INSERT);
    return false;
}