Tabnine Logo
Auditable.setUpdator
Code IndexAdd Tabnine to your IDE (free)

How to use
setUpdator
method
in
uk.ac.ebi.intact.model.Auditable

Best Java code snippets using uk.ac.ebi.intact.model.Auditable.setUpdator (Showing top 4 results out of 315)

origin: uk.ac.ebi.intact/intact-core

public boolean onPreInsert( PreInsertEvent preInsertEvent ) {
  if ( !( preInsertEvent.getEntity() instanceof Auditable ) ) {
    log.debug( "No auditable object: " + preInsertEvent.getId() );
    return false;
  }
  log.debug( "Inserting audit info for: " + preInsertEvent.getId() );
  Date now = new Date();
  Auditable auditable = ( Auditable ) preInsertEvent.getEntity();
  auditable.setCreated( now );
  auditable.setUpdated( now );
  String currentUser = IntactContext.getCurrentInstance().getUserContext().getUserId().toUpperCase();
  auditable.setCreator( currentUser );
  auditable.setUpdator( currentUser );
  String[] names = preInsertEvent.getPersister().getPropertyNames();
  Object[] values = preInsertEvent.getState();
  for ( int i = 0; i < names.length; i++ ) {
    if ( names[i].equals( "created" ) || names[i].equals( "updated" ) ) {
      values[i] = now;
      continue;
    }
    if ( names[i].equals( "creator" ) || names[i].equals( "updator" ) ) {
      log.debug( "Current user " + currentUser );
      values[i] = currentUser;
    }
  }
  return false;
}
origin: uk.ac.ebi.intact.core/intact-core

  auditable.setCreator( currentUser );
auditable.setUpdator( currentUser );
origin: uk.ac.ebi.intact.core/intact-core-readonly

  auditable.setCreator( currentUser );
auditable.setUpdator( currentUser );
origin: uk.ac.ebi.intact/intact-core

auditable.setUpdator( currentUser );
uk.ac.ebi.intact.modelAuditablesetUpdator

Popular methods of Auditable

  • getCreated
  • getCreator
  • setCreated
  • setCreator
  • setUpdated

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getApplicationContext (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best IntelliJ plugins
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