It seems there is frustration about hibernate ansd the deprecation of the 
addPackage method.

And no immediate documented solution to adding a blanket package to a 
Configuration in order to iterate all the classes.

Does anyone know how to do this ?

I know this might be the wrong board. But the hibernate support in tapestry is 
relevent.

Any help is appreciated.

I need a workiarond for addPackage.

Here is a code snippet.

Thanks in advance

Ken

    public void configure(Configuration configuration)
    {
        ClassLoader contextClassLoader = 
Thread.currentThread().getContextClassLoader();

        for (String packageName : packageManager.getPackageNames())
        {
            configuration.addPackage(packageName);      // *** refuses to 
compile...method undefined **//

            for (String className : 
classNameLocator.locateClassNames(packageName))
            {
                try
                {
                    Class entityClass = contextClassLoader.loadClass(className);

                    configuration.addClass(entityClass);
                }
                catch (ClassNotFoundException ex)
                {
                    throw new RuntimeException(ex);
                }
            }
        }
    } 
                                          

Reply via email to