public static GroupsPerOperation from(Map settings, ClassLoaderAccess classLoaderAccess) { GroupsPerOperation groupsPerOperation = new GroupsPerOperation(); applyOperationGrouping( groupsPerOperation, Operation.INSERT, settings, classLoaderAccess ); applyOperationGrouping( groupsPerOperation, Operation.UPDATE, settings, classLoaderAccess ); applyOperationGrouping( groupsPerOperation, Operation.DELETE, settings, classLoaderAccess ); applyOperationGrouping( groupsPerOperation, Operation.DDL, settings, classLoaderAccess ); return groupsPerOperation; }
private void init(ValidatorFactory factory, Properties properties) { this.factory = factory; groupsPerOperation = new GroupsPerOperation( properties ); initialized = true; }
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 ); } } }
private void init(ValidatorFactory factory, Properties properties) { this.factory = factory; groupsPerOperation = new GroupsPerOperation( properties ); initialized = true; }
private void init(ValidatorFactory factory, Properties properties) { this.factory = factory; groupsPerOperation = new GroupsPerOperation( properties ); initialized = true; }
public static GroupsPerOperation from(Map settings, ClassLoaderAccess classLoaderAccess) { GroupsPerOperation groupsPerOperation = new GroupsPerOperation(); applyOperationGrouping( groupsPerOperation, Operation.INSERT, settings, classLoaderAccess ); applyOperationGrouping( groupsPerOperation, Operation.UPDATE, settings, classLoaderAccess ); applyOperationGrouping( groupsPerOperation, Operation.DELETE, settings, classLoaderAccess ); applyOperationGrouping( groupsPerOperation, Operation.DDL, settings, classLoaderAccess ); return groupsPerOperation; }
@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 ); } } }
@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 ); } } }