}
}
}
private void parseMappingElement(Element mappingElement, String name) {
final Attribute resourceAttribute = mappingElement.attribute( "resource" );
final Attribute fileAttribute = mappingElement.attribute( "file" );
final Attribute jarAttribute = mappingElement.attribute( "jar" );
final Attribute packageAttribute = mappingElement.attribute( "package" );
final Attribute classAttribute = mappingElement.attribute( "class" );
if ( resourceAttribute != null ) {
final String resourceName = resourceAttribute.getValue();
LOG.debugf("Session-factory config [%s] named resource [%s] for mapping", name, resourceName);
addResource( resourceName );
}
else if ( fileAttribute != null ) {
final String fileName = fileAttribute.getValue();
LOG.debugf("Session-factory config [%s] named file [%s] for mapping", name, fileName);
addFile( fileName );
}
else if ( jarAttribute != null ) {
final String jarFileName = jarAttribute.getValue();
LOG.debugf("Session-factory config [%s] named jar file [%s] for mapping", name, jarFileName);
addJar( new File( jarFileName ) );
}
else if ( packageAttribute != null ) {
final String packageName = packageAttribute.getValue();
LOG.debugf("Session-factory config [%s] named package [%s] for mapping", name, packageName);
addPackage( packageName );
}
else if ( classAttribute != null ) {
final String className = classAttribute.getValue();
LOG.debugf("Session-factory config [%s] named class [%s] for mapping", name, className);
try {
addAnnotatedClass( ReflectHelper.classForName( className ) );
}
catch ( Exception e ) {