Hello, I want to create a finder for a component, as this:
Code:
<component name="versionNumber" class="nl.....VersionNumber">
<property name="major" column="MAJOR_NR" type="java.lang.Integer" not-null="true"/>
<property name="minor" column="MINOR_NR" type="java.lang.Integer" not-null="true"/>
<meta attribute="finder-method">findByVersionNumber</meta>
</component>
When I generate the .java classes, including the finder, I get this:
Code:
public static List findByVersionNumber(Integer major) throws HibernateException {
Session session = HibernateSessionFilter.getSession();
List finds = session.find("from nl.....VersionNumber as versionNumber where versionNumber.major=?", major, Hibernate.INTEGER);
return finds;
}
public static List findByVersionNumber(Integer minor) throws HibernateException {
Session session = HibernateSessionFilter.getSession();
List finds = session.find("from nl......VersionNumber as versionNumber where versionNumber.minor=?", minor, Hibernate.INTEGER);
return finds;
}
Naturally this is not what I want. At first it won't compile, because it's basically the same method implemented twice. Moreover I want to find all Versions by their (combined) VersionNumber, not by major or minor number. Can anybody tell me how I can get this generated, as opposed to building it myself?