Tabnine Logo
AbstractPreDatabaseOperationEvent
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractPreDatabaseOperationEvent
in
org.hibernate.event.spi

Best Java code snippets using org.hibernate.event.spi.AbstractPreDatabaseOperationEvent (Showing top 9 results out of 315)

origin: hibernate/hibernate-orm

/**
 * Getter for property 'source'.  This is the session from which the event
 * originated.
 * <p/>
 * Some of the pre-* events had previous exposed the event source using
 * getSource() because they had not originally extended from
 * {@link AbstractEvent}.
 *
 * @return Value for property 'source'.
 *
 * @deprecated Use {@link #getSession} instead
 */
@Deprecated
public EventSource getSource() {
  return getSession();
}
origin: org.grails/grails-datastore-gorm-hibernate-core

private void synchronizePersisterState(AbstractPreDatabaseOperationEvent event, Object[] state) {
  EntityPersister persister = event.getPersister();
  synchronizePersisterState(event, state, persister, persister.getPropertyNames());
}
origin: org.grails/grails-datastore-gorm-hibernate-core

private void synchronizePersisterState(AbstractPreDatabaseOperationEvent event, Object[] state, EntityPersister persister, String[] propertyNames) {
  Object entity = event.getEntity();
  EntityReflector reflector = persistentEntity.getReflector();
  HashMap<Integer, Object> changedState= new HashMap<>();
  EntityMetamodel entityMetamodel = persister.getEntityMetamodel();
  for (int i = 0; i < propertyNames.length; i++) {
    String p = propertyNames[i];
    Integer index = entityMetamodel.getPropertyIndexOrNull(p);
    if(index == null) continue;
    
    PersistentProperty property = persistentEntity.getPropertyByName(p);
    if (property == null) {
      continue;
    }
    String propertyName = property.getName();
    if(GormProperties.VERSION.equals(propertyName)) {
      continue;
    }
    Object value = reflector.getProperty(entity, propertyName);
    if(state[index] != value) {
      changedState.put(i, value);
    }
    state[index] = value;
  }
  synchronizeEntityUpdateActionState(event, entity, changedState);
}
origin: hibernate/hibernate-orm

  protected void performSecurityCheck(
      SessionImplementor session,
      PermissionCheckEntityInformation entityInformation,
      PermissibleAction action) {
    if ( jaccService == null ) {
      jaccService = session.getFactory().getServiceRegistry().getService( JaccService.class );
    }
    jaccService.checkPermission( entityInformation, action );
  }
}
origin: org.hibernate/com.springsource.org.hibernate

  /**
   * Getter for property 'source'.  This is the session from which the event
   * originated.
   * <p/>
   * Some of the pre-* events had previous exposed the event source using
   * getSource() because they had not originally extended from
   * {@link AbstractEvent}.
   *
   * @return Value for property 'source'.
   * @deprecated Use {@link #getSession} instead
   */
  public EventSource getSource() {
    return getSession();
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

  /**
   * Getter for property 'source'.  This is the session from which the event
   * originated.
   * <p/>
   * Some of the pre-* events had previous exposed the event source using
   * getSource() because they had not originally extended from
   * {@link AbstractEvent}.
   *
   * @return Value for property 'source'.
   * @deprecated Use {@link #getSession} instead
   */
  public EventSource getSource() {
    return getSession();
  }
}
origin: org.hibernate.orm/hibernate-core

/**
 * Getter for property 'source'.  This is the session from which the event
 * originated.
 * <p/>
 * Some of the pre-* events had previous exposed the event source using
 * getContainer() because they had not originally extended from
 * {@link AbstractEvent}.
 *
 * @return Value for property 'source'.
 *
 * @deprecated Use {@link #getSession} instead
 */
@Deprecated
public EventSource getSource() {
  return getSession();
}
origin: org.grails/grails-datastore-gorm-hibernate-core

private void synchronizeEntityUpdateActionState(AbstractPreDatabaseOperationEvent event, Object entity,
                        HashMap<Integer, Object> changedState) {
  if(actionQueueUpdatesField != null && event instanceof PreInsertEvent && changedState.size() > 0) {
    try {
      ExecutableList<EntityUpdateAction> updates = (ExecutableList<EntityUpdateAction>)actionQueueUpdatesField.get(event.getSession().getActionQueue());
      if(updates != null) {
        for (EntityUpdateAction updateAction : updates) {
          if(updateAction.getInstance() == entity) {
            Object[] updateState = (Object[])entityUpdateActionStateField.get(updateAction);
            if (updateState != null) {
              for(Map.Entry<Integer, Object> entry : changedState.entrySet()) {
                updateState[entry.getKey()] = entry.getValue();
              }
            }
          }
        }
      }
    }
    catch (Exception e) {
      LOG.warn("Error synchronizing object state with Hibernate: " + e.getMessage(), e);
    }
  }
}
origin: org.hibernate.orm/hibernate-core

  protected void performSecurityCheck(
      SessionImplementor session,
      PermissionCheckEntityInformation entityInformation,
      PermissibleAction action) {
    if ( jaccService == null ) {
      jaccService = session.getFactory().getServiceRegistry().getService( JaccService.class );
    }
    jaccService.checkPermission( entityInformation, action );
  }
}
org.hibernate.event.spiAbstractPreDatabaseOperationEvent

Javadoc

Represents an operation we are about to perform against the database.

Most used methods

  • getSession
  • getEntity
    Retrieves the entity involved in the database operation.
  • getPersister
    The persister for the #getEntity.

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now