Codota Logo
TypeSafeActivator.applyDDL
Code IndexAdd Codota to your IDE (free)

How to use
applyDDL
method
in
org.hibernate.cfg.beanvalidation.TypeSafeActivator

Best Java code snippets using org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-orm

applyDDL( "", persistentClass, clazz, factory, groups, true, dialect );
origin: hibernate/hibernate-orm

applyDDL(
    prefix + propertyDesc.getPropertyName() + ".",
    persistentClass, componentClass, factory, groups,
origin: org.hibernate/hibernate-annotations

public static void applyDDL(Collection<PersistentClass> persistentClasses, Properties properties) {
  ValidatorFactory factory = getValidatorFactory( properties );
  Class<?>[] groupsArray = new GroupsPerOperation( properties ).get( GroupsPerOperation.Operation.DDL );
  Set<Class<?>> groups = new HashSet<Class<?>>( Arrays.asList( groupsArray ) );
  for ( PersistentClass persistentClass : persistentClasses ) {
    final String className = persistentClass.getClassName();
    if ( className == null || className.length() == 0) continue;
    Class<?> clazz;
    try {
      clazz = ReflectHelper.classForName( className, TypeSafeActivator.class );
    }
    catch ( ClassNotFoundException e ) {
      throw new AssertionFailure( "Entity class not found", e);
    }
    try {
      applyDDL( "", persistentClass, clazz, factory, groups, true );
    }
    catch (Exception e) {
      logger.warn( "Unable to apply constraints on DDL for " + className, e );
    }
  }
}
origin: org.hibernate/hibernate-annotations

private static void applyDDL(String prefix,
               PersistentClass persistentClass,
               Class<?> clazz,
               ValidatorFactory factory,
               Set<Class<?>> groups,
               boolean activateNotNull) {
  final BeanDescriptor descriptor = factory.getValidator().getConstraintsForClass( clazz );
  //no bean level constraints can be applied, go to the properties
  for ( PropertyDescriptor propertyDesc : descriptor.getConstrainedProperties() ) {
    Property property = findPropertyByName( persistentClass, prefix + propertyDesc.getPropertyName() );
    boolean hasNotNull = false;
    if ( property != null ) {
      hasNotNull = applyConstraints( propertyDesc.getConstraintDescriptors(), property, propertyDesc, groups, activateNotNull );
      if ( property.isComposite() && propertyDesc.isCascaded() ) {
        Class<?> componentClass = ( ( Component ) property.getValue() ).getComponentClass();
        /*
         * we can apply not null if the upper component let's us activate not null
         * and if the property is not null.
         * Otherwise, all sub columns should be left nullable
         */
        final boolean canSetNotNullOnColumns = activateNotNull && hasNotNull;
        applyDDL( prefix + propertyDesc.getPropertyName() + ".",
            persistentClass, componentClass, factory, groups,
            canSetNotNullOnColumns
        );
      }
      //FIXME add collection of components
    }
  }
}
origin: org.hibernate/com.springsource.org.hibernate

@SuppressWarnings( {"UnusedDeclaration"})
public static void applyDDL(Collection<PersistentClass> persistentClasses, Properties properties, Dialect dialect) {
  ValidatorFactory factory = getValidatorFactory( properties );
  Class<?>[] groupsArray = new GroupsPerOperation( properties ).get( GroupsPerOperation.Operation.DDL );
  Set<Class<?>> groups = new HashSet<Class<?>>( Arrays.asList( groupsArray ) );
  for ( PersistentClass persistentClass : persistentClasses ) {
    final String className = persistentClass.getClassName();
    if ( className == null || className.length() == 0 ) {
      continue;
    }
    Class<?> clazz;
    try {
      clazz = ReflectHelper.classForName( className, TypeSafeActivator.class );
    }
    catch ( ClassNotFoundException e ) {
      throw new AssertionFailure( "Entity class not found", e );
    }
    try {
      applyDDL( "", persistentClass, clazz, factory, groups, true, dialect );
    }
    catch (Exception e) {
      LOG.unableToApplyConstraints( className, e );
    }
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

@SuppressWarnings( {"UnusedDeclaration"})
public static void applyDDL(Collection<PersistentClass> persistentClasses, Properties properties, Dialect dialect) {
  ValidatorFactory factory = getValidatorFactory( properties );
  Class<?>[] groupsArray = new GroupsPerOperation( properties ).get( GroupsPerOperation.Operation.DDL );
  Set<Class<?>> groups = new HashSet<Class<?>>( Arrays.asList( groupsArray ) );
  for ( PersistentClass persistentClass : persistentClasses ) {
    final String className = persistentClass.getClassName();
    if ( className == null || className.length() == 0 ) {
      continue;
    }
    Class<?> clazz;
    try {
      clazz = ReflectHelper.classForName( className, TypeSafeActivator.class );
    }
    catch ( ClassNotFoundException e ) {
      throw new AssertionFailure( "Entity class not found", e );
    }
    try {
      applyDDL( "", persistentClass, clazz, factory, groups, true, dialect );
    }
    catch (Exception e) {
      LOG.unableToApplyConstraints( className, e );
    }
  }
}
origin: org.hibernate.orm/hibernate-core

applyDDL( "", entityMapping, clazz, factory, groups, true, dialect );
origin: org.hibernate/com.springsource.org.hibernate

applyDDL(
    prefix + propertyDesc.getPropertyName() + ".",
    persistentClass, componentClass, factory, groups,
origin: org.hibernate.orm/hibernate-core

applyDDL(
    prefix + propertyDesc.getPropertyName() + ".",
    persistentClass, componentClass, factory, groups,
origin: org.hibernate/com.springsource.org.hibernate.core

applyDDL(
    prefix + propertyDesc.getPropertyName() + ".",
    persistentClass, componentClass, factory, groups,
org.hibernate.cfg.beanvalidationTypeSafeActivatorapplyDDL

Popular methods of TypeSafeActivator

  • applyConstraints
  • applyDigits
  • applyLength
  • applyMax
  • applyMin
  • applyNotNull
  • applySize
  • findPropertyByName
  • getValidatorFactory
  • applySQLCheck
  • applyCallbackListeners
  • applyRelationalConstraints
  • applyCallbackListeners,
  • applyRelationalConstraints,
  • resolveProvidedFactory,
  • getColumn,
  • isComposite

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
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