Hmmm ... looking at the addCachable code, I think you will have to override it to look for the files inside .jar.
Look at how normal .hbm.xml files are loadad from .jar (addJar() method).
Code:
public Configuration addJar(File jar) throws MappingException {
log.info( "Searching for mapping documents in jar: " + jar.getName() );
final JarFile jarFile;
try {
jarFile = new JarFile( jar );
}
catch ( IOException ioe ) {
throw new MappingException( "Could not read mapping documents from jar: " + jar.getName(), ioe );
}
Enumeration jarEntries = jarFile.entries();
while ( jarEntries.hasMoreElements() ) {
ZipEntry ze = ( ZipEntry ) jarEntries.nextElement();
if ( ze.getName().endsWith( ".hbm.xml" ) ) {
log.info( "Found mapping document in jar: " + ze.getName() );
try {
addInputStream( jarFile.getInputStream( ze ) );
}
catch ( Exception e ) {
throw new MappingException( "Could not read mapping documents from jar: " + jar.getName(), e );
}
}
}
return this;
}