Can I configure Hibernate to scan packages automatically to create a SessionFactory
from @Entity
annotated beans ?
Currently I am using >
public static ArrayList listfiles(String pckgname) {
ArrayList classes=new ArrayList();
try{
// Get a File object for the package
File directory=null;
try {
directory=new File(Thread.currentThread().getContextClassLoader().getResource(pckgname.replace('.', '/')).getFile());
} catch(NullPointerException x) {
System.out.println("Nullpointer");
throw new ClassNotFoundException(pckgname+" does not appear to be a valid package");
}
if(directory.exists()) {
// Get the list of the files contained in the package
String[] files=directory.list();
for(int i=0; i