X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=dist%2Fhibernate4-maven-plugin-1.0.2%2Fxref%2Fde%2Fjuplo%2Fplugins%2Fhibernate4%2FValidationConfiguration.html;fp=dist%2Fhibernate4-maven-plugin-1.0.2%2Fxref%2Fde%2Fjuplo%2Fplugins%2Fhibernate4%2FValidationConfiguration.html;h=0000000000000000000000000000000000000000;hb=b293b312d6f0dd8b2dc716375fd442dd295a9942;hp=6c507acce902be1cbf00422355842baf3d0f1e4d;hpb=9179a67d9952d3b63e95686dbd6cacd3c9e13cb2;p=website diff --git a/dist/hibernate4-maven-plugin-1.0.2/xref/de/juplo/plugins/hibernate4/ValidationConfiguration.html b/dist/hibernate4-maven-plugin-1.0.2/xref/de/juplo/plugins/hibernate4/ValidationConfiguration.html deleted file mode 100644 index 6c507acc..00000000 --- a/dist/hibernate4-maven-plugin-1.0.2/xref/de/juplo/plugins/hibernate4/ValidationConfiguration.html +++ /dev/null @@ -1,73 +0,0 @@ - - -
- -- -1 package de.juplo.plugins.hibernate4; -2 -3 import javax.validation.Validation; -4 -5 import org.hibernate.cfg.Configuration; -6 import org.hibernate.cfg.beanvalidation.TypeSafeActivatorAccessor; -7 import org.hibernate.dialect.Dialect; -8 import org.hibernate.metamodel.source.MappingException; -9 -10 -11 /** -12 * This integration is usually performed by BeanValidationIntegrator. -13 * Unfortunately, that integration will only be activated upon -14 * initialization of the ServiceRegistry, which initializes -15 * DatasourceConnectionProviderImpl, which looks up the datasource, -16 * which requires a JNDI context ... -17 * We therefore reimplement the relevant parts of BeanValidatorIntegrator. -18 * Since that must occur after secondPassCompile(), which is invoked by -19 * Configuration.generateSchemaCreationScript, which is invoked by -20 * SchemaExport, some fancy subclassing is needed to invoke the integration -21 * at the right time. -22 * @author Mark Robinson <mark@mrobinson.ca> -23 * @author Frank Schimmel <frank.schimmel@cm4all.com> -24 */ -25 public class ValidationConfiguration extends Configuration -26 { -27 private static final long serialVersionUID = 1L; -28 -29 private Class<Dialect> dialectClass; -30 -31 public ValidationConfiguration(final String dialectClass) -32 { -33 try { -34 this.dialectClass = (Class<Dialect>) Class.forName(dialectClass); -35 } catch (ClassNotFoundException e) { -36 throw new RuntimeException(e); -37 } -38 } -39 -40 @Override -41 protected void secondPassCompile() throws MappingException -42 { -43 super.secondPassCompile(); -44 -45 try -46 { -47 TypeSafeActivatorAccessor.applyRelationalConstraints( -48 Validation.buildDefaultValidatorFactory(), -49 classes.values(), -50 getProperties(), -51 dialectClass.newInstance() -52 ); -53 } -54 catch (Exception e) -55 { -56 throw new RuntimeException(e); -57 } -58 } -59 } --