I have an Java method I want to call within my Jython servlet running on tomcat5. It looks like this:
@SuppressWarnings("unchecked")
public School loadByName(String name) {
List<School> school;
school = getHibernateTemplate().find("from " + getPersistentClass().getName() + " where name = ?", name);
return uniqueResult(school);
}
I call it in Jython using:
foobar = SchoolDAOHibernate.loadByName('University')
It throws an error that says loadByName() expects 2 args; got 1. What other argument could it be looking for?
If i try to create an instance first such as:
foo = com.dc.sports.dao.hibernate.SchoolDaoHibernate()
foo.loadByName('University')
The first call throws an exception saying:
No visible constructors for class (com.dc.sports.dao.hibernate.SchoolDaoHibernate)
I'm assuming this is because it is a private-package:
package com.dc.sports.dao.hibernate;
...
@SuppressWarnings("unchecked")
class SchoolDaoHibernate extends AbstractDaoHibernate<School> implements SchoolDao {
So how can I get at the method?