Hi Gavin,
Indeed, it only seems to be for findAll methods that the generator createsm are with the deprecated syntax. Finder methods defined as meta attribute use the correct syntax.
I'm using a HibernateExtensions-2.0.2, though I've no time at the moment, I'll have a look inside the source and see if theres anything untoward, I'll post my findings toward the end of the week.
As part of thw .hbm I defined a
<property
name="name"
type="java.lang.String"
column="name"
not-null="true"
length="255"
>
<meta attribute="finder">findByName</meta>
</property>
The resulting code...
public class AccessGatewaysFinder implements Serializable {
public static List findByName(Session session, java.lang.String name) throws SQLException, HibernateException {
List finds = session.find("from AccessGateways as accessgateways where accessgateways.name=?", name, Hibernate.STRING);
return finds;
}
public static List findAll(Session session) throws SQLException, HibernateException {
List finds = session.find("from AccessGateways in class com.wificom.sab.data.hibernate.AccessGateways");
return finds;
}
}
|