protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/manyToManyAudited/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/oneToManyNotAudited/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/oneToManyAudited/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/singleAssociatedAudited/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/manyToManyAudited/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/singleAssociatedNotAudited/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/singleAssociatedAudited/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
protected void initMappings() throws MappingException, URISyntaxException { URL url = Thread.currentThread().getContextClassLoader().getResource( "mappings/entityNames/auditedEntity/mappings.hbm.xml" ); config.addFile( new File( url.toURI() ) ); }
public void testAuditedDynamicComponentFailure() throws URISyntaxException { final Configuration config = new Configuration(); final URL hbm = Thread.currentThread().getContextClassLoader().getResource( "mappings/dynamicComponents/mapAudited.hbm.xml" ); config.addFile( new File( hbm.toURI() ) ); final String auditStrategy = getAuditStrategy(); if ( !StringTools.isEmpty( auditStrategy ) ) { config.setProperty( EnversSettings.AUDIT_STRATEGY, auditStrategy ); } final ServiceRegistry serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry( config.getProperties() ); try { config.buildSessionFactory( serviceRegistry ); Assert.fail( "MappingException expected" ); } catch ( MappingException e ) { Assert.assertEquals( "Audited dynamic-component properties are not supported. Consider applying @NotAudited annotation to " + AuditedDynamicComponentEntity.class.getName() + "#customFields.", e.getMessage() ); } finally { ServiceRegistryBuilder.destroy( serviceRegistry ); } }
@Override public AnnotationConfiguration addFile(String xmlFile) throws MappingException { super.addFile( xmlFile ); return this; }
@Override public AnnotationConfiguration addFile(File xmlFile) throws MappingException { super.addFile( xmlFile ); return this; }
public void apply(Object target, WireContext wireContext) { Configuration configuration = (Configuration) target; configuration.addFile(fileName); } public String toString() {
@Override public AnnotationConfiguration addFile(File xmlFile) throws MappingException { super.addFile( xmlFile ); return this; }
@Override public AnnotationConfiguration addFile(String xmlFile) throws MappingException { super.addFile( xmlFile ); return this; }
@Override public void apply(final Object target, final WireContext wireContext) { final Configuration configuration = (Configuration) target; configuration.addFile(fileName); }
@Override public Configuration addFile(String xmlFile) throws MappingException { super.addFile(xmlFile); return this; }
@Override public Configuration addFile(File xmlFile) throws MappingException { super.addFile(xmlFile); return this; }
private static boolean addMappingFilesToConfiguration(final Configuration cfg) { boolean haveReadAMappingFile = false; NakedObjectConfiguration config = NakedObjectsContext.getConfiguration(); final String path = config.getString(PROPERTY_PREFIX + "hbm-export", config.rootPath() + FILE_SEPERATOR + MAPPING_DIR); final List<File> mappingFiles = readMappingFiles(path); for (final File file : mappingFiles) { cfg.addFile(file); haveReadAMappingFile = true; LOG.info("reading mapping file: " + file.getAbsolutePath()); } return haveReadAMappingFile; }