コード例 #1
0
  @Override
  protected void configure(Configuration cfg) {
    super.configure(cfg);
    final MessageInterpolator messageInterpolator =
        new MessageInterpolator() {

          public String interpolate(String s, Context context) {
            return "Oops";
          }

          public String interpolate(String s, Context context, Locale locale) {
            return interpolate(s, context);
          }
        };
    final javax.validation.Configuration<?> configuration =
        Validation.byDefaultProvider().configure();
    configuration.messageInterpolator(messageInterpolator);
    ValidatorFactory vf = configuration.buildValidatorFactory();
    cfg.getProperties().put("javax.persistence.validation.factory", vf);
    cfg.setProperty("javax.persistence.validation.mode", "AUTO");
  }
コード例 #2
0
 private Configuration constructAndConfigureConfiguration() {
   Configuration cfg = constructConfiguration();
   configure(cfg);
   return cfg;
 }
コード例 #3
0
 @Override
 public void configure(Configuration cfg) {
   super.configure(cfg);
   cfg.setPhysicalNamingStrategy(new TestingNamingStrategy());
 }
コード例 #4
0
 @Override
 protected void configure(Configuration cfg) {
   super.configure(cfg);
   cfg.addResource("org/hibernate/test/annotations/id/sequences/orm.xml");
 }
コード例 #5
0
 protected void configure(Configuration cfg) {
   super.configure(cfg);
   cfg.setProperty(Environment.ENABLE_LAZY_LOAD_NO_TRANS, "true");
 }
 public void configure(Configuration cfg) {
   super.configure(cfg);
   cfg.setProperty("hibernate.event.merge.entity_copy_observer", "allow");
 }