alessandrocma wrote:
Where named query are declared ? In application.xml of Spring ?
if i get you right you are using spring + hibernate to develope your app. in application.xml file of spring you declare your app's beans and how they service their client not a named quiries.
you can define your named queries in two simple ways:
1. by using xdoclet and declaring your named query in ur pojo class like this
Code:
/**
* @hibernate.class table="tbl_acc_account"
* @hibernate.query name="accountByCode" value="FROM Account a WHERE a.accountCode=?"
*/
public class Account ...
2. declaring named query in .hbm.xml file of a related pojo
Code:
<query name="accountByCode">
<![CDATA[FROM Account a WHERE a.accountCode=?]]>
</query>