@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"); }
private Configuration constructAndConfigureConfiguration() { Configuration cfg = constructConfiguration(); configure(cfg); return cfg; }
@Override public void configure(Configuration cfg) { super.configure(cfg); cfg.setPhysicalNamingStrategy(new TestingNamingStrategy()); }
@Override protected void configure(Configuration cfg) { super.configure(cfg); cfg.addResource("org/hibernate/test/annotations/id/sequences/orm.xml"); }
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"); }