}
@SuppressWarnings("unchecked")
public GenericDao createDao(CrudManagedObject cmo)
throws Exception {
GenericDaoFactory genericDaoFactory = new GenericDaoFactory();
genericDaoFactory.setTransactionInterceptor(transactionInterceptor());
if (cmo.getDaoInterface() == null) {
genericDaoFactory.setInterface(GenericDao.class);
} else {
genericDaoFactory.setInterface(cmo.getDaoInterface());
}
genericDaoFactory.setQueryHints(cmo.getQueryHints());
genericDaoFactory.setNewSelect(cmo.getNewSelect());
genericDaoFactory.setBo(cmo.getEntityType());
genericDaoFactory.setEntityManagerFactory(entityManagerFactory());
genericDaoFactory.afterPropertiesSet();
return (GenericDao) genericDaoFactory.getObject();
}