Codota Logo
BeanValidationEventListener.initialize
Code IndexAdd Codota to your IDE (free)

How to use
initialize
method
in
org.hibernate.cfg.beanvalidation.BeanValidationEventListener

Best Java code snippets using org.hibernate.cfg.beanvalidation.BeanValidationEventListener.initialize (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-orm

@SuppressWarnings( {"UnusedDeclaration"})
public static void applyCallbackListeners(ValidatorFactory validatorFactory, ActivationContext activationContext) {
  final Set<ValidationMode> modes = activationContext.getValidationModes();
  if ( ! ( modes.contains( ValidationMode.CALLBACK ) || modes.contains( ValidationMode.AUTO ) ) ) {
    return;
  }
  final ConfigurationService cfgService = activationContext.getServiceRegistry().getService( ConfigurationService.class );
  final ClassLoaderService classLoaderService = activationContext.getServiceRegistry().getService( ClassLoaderService.class );
  // de-activate not-null tracking at the core level when Bean Validation is present unless the user explicitly
  // asks for it
  if ( cfgService.getSettings().get( Environment.CHECK_NULLABILITY ) == null ) {
    activationContext.getSessionFactory().getSessionFactoryOptions().setCheckNullability( false );
  }
  final BeanValidationEventListener listener = new BeanValidationEventListener(
      validatorFactory,
      cfgService.getSettings(),
      classLoaderService
  );
  final EventListenerRegistry listenerRegistry = activationContext.getServiceRegistry()
      .getService( EventListenerRegistry.class );
  listenerRegistry.addDuplicationStrategy( DuplicationStrategyImpl.INSTANCE );
  listenerRegistry.appendListeners( EventType.PRE_INSERT, listener );
  listenerRegistry.appendListeners( EventType.PRE_UPDATE, listener );
  listenerRegistry.appendListeners( EventType.PRE_DELETE, listener );
  listener.initialize( cfgService.getSettings(), classLoaderService );
}
origin: org.hibernate/com.springsource.org.hibernate

@SuppressWarnings( {"UnusedDeclaration"})
public static void activateBeanValidation(EventListenerRegistry listenerRegistry, Configuration configuration) {
  final Properties properties = configuration.getProperties();
  ValidatorFactory factory = getValidatorFactory( properties );
  BeanValidationEventListener listener = new BeanValidationEventListener(
      factory, properties
  );
  listenerRegistry.addDuplicationStrategy( DuplicationStrategyImpl.INSTANCE );
  listenerRegistry.appendListeners( EventType.PRE_INSERT, listener );
  listenerRegistry.appendListeners( EventType.PRE_UPDATE, listener );
  listenerRegistry.appendListeners( EventType.PRE_DELETE, listener );
  listener.initialize( configuration );
}
origin: org.hibernate/com.springsource.org.hibernate.core

@SuppressWarnings( {"UnusedDeclaration"})
public static void activateBeanValidation(EventListenerRegistry listenerRegistry, Configuration configuration) {
  final Properties properties = configuration.getProperties();
  ValidatorFactory factory = getValidatorFactory( properties );
  BeanValidationEventListener listener = new BeanValidationEventListener(
      factory, properties
  );
  listenerRegistry.addDuplicationStrategy( DuplicationStrategyImpl.INSTANCE );
  listenerRegistry.appendListeners( EventType.PRE_INSERT, listener );
  listenerRegistry.appendListeners( EventType.PRE_UPDATE, listener );
  listenerRegistry.appendListeners( EventType.PRE_DELETE, listener );
  listener.initialize( configuration );
}
origin: org.hibernate.orm/hibernate-core

@SuppressWarnings( {"UnusedDeclaration"})
public static void applyCallbackListeners(ValidatorFactory validatorFactory, ActivationContext activationContext) {
  final Set<ValidationMode> modes = activationContext.getValidationModes();
  if ( ! ( modes.contains( ValidationMode.CALLBACK ) || modes.contains( ValidationMode.AUTO ) ) ) {
    return;
  }
  final ConfigurationService cfgService = activationContext.getServiceRegistry().getService( ConfigurationService.class );
  final ClassLoaderService classLoaderService = activationContext.getServiceRegistry().getService( ClassLoaderService.class );
  // de-activate not-null tracking at the core level when Bean Validation is present unless the user explicitly
  // asks for it
  if ( cfgService.getSettings().get( Environment.CHECK_NULLABILITY ) == null ) {
    activationContext.getSessionFactory().getSessionFactoryOptions().setCheckNullability( false );
  }
  final BeanValidationEventListener listener = new BeanValidationEventListener(
      validatorFactory,
      cfgService.getSettings(),
      classLoaderService
  );
  final EventListenerRegistry listenerRegistry = activationContext.getServiceRegistry()
      .getService( EventListenerRegistry.class );
  listenerRegistry.addDuplicationStrategy( DuplicationStrategyImpl.INSTANCE );
  listenerRegistry.appendListeners( EventType.PRE_INSERT, listener );
  listenerRegistry.appendListeners( EventType.PRE_UPDATE, listener );
  listenerRegistry.appendListeners( EventType.PRE_DELETE, listener );
  listener.initialize( cfgService.getSettings(), classLoaderService );
}
org.hibernate.cfg.beanvalidationBeanValidationEventListenerinitialize

Popular methods of BeanValidationEventListener

  • <init>
    Constructor used in an environment where validator factory is injected (JPA2).
  • init
  • toString
  • validate

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • Menu (java.awt)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now