用一般查询语句写finder方法
多个bean对象放入Collection,
返回Collection就可以了

解决方案 »

  1.   

    我没写过,能给点源码或一点引导吗?
    对了,我在XXHome.java里加一个remove方法都不行??
    各位大哥,我时刻关注着!分不够再加!
      

  2.   

    /**
     * For each finder method defined in the home interface other than the create and 
     * findByPrimaryKey methods, an implementation must be defined here.  For example,
     * suppose the home interface contained the method: 
     * public java.util.Enumeration findGreaterThan(int threshold) throws java.rmi.RemoteException, javax.ejb.FinderException;
     * The implementation can take one of three forms:
     *
     * SELECT Custom Finder:
     *    Note: For compatibility with old code.  Do not use this form for new development.
     *
     *    public static final String findGreaterThanQueryString = "SELECT * FROM MYTABLE T1 WHERE T1.VALUE > ?";
     *
     * WHERE Custom Finder:
     *
     *    public static final String findGreaterThanWhereClause = "T1.VALUE > ?";
     *
     * Method Custom Finder:
     *
     *    public java.sql.PreparedStatement findGreaterThan(int threshold) throws Exception;
     *
     * These implementations will be referenced by the persister class generated when
     * deployed code is generated.
     **/