package com.onionProtal.until.Model;import java.sql.ResultSet;public class PostsPageList {
private int RowCount;
private int PageCount;
private ResultSet res;
public int getRowCount() {
return RowCount;
}
public void setRowCount(int rowCount) {
RowCount = rowCount;
}
public int getPageCount() {
return PageCount;
}
public void setPageCount(int pageCount) {
PageCount = pageCount;
}
public ResultSet getRes() {
return res;
}
public void setRes(ResultSet res) {
this.res = res;
}
}
有个这样的Java类但是不是hibernate的表模板。我想用spring IOC容器造,请问怎么造,并且调用
定义一个工厂bean
import org.springframework.beans.factory.FactoryBean;public class PostsPageListFactoryBean implements FactoryBean { public Object getObject() throws Exception {
return new PostsPageList();
} public Class<PostsPageList> getObjectType() {
return PostsPageList.class;
} public boolean isSingleton() {
return false;
}}
然后在spring的配置文件里一下你的工厂<bean id="postsPageList"
class="com.onionProtal.until.model.PostsPageListFactoryBean"
scope="prototype"
/>
以后你拿到的名为postsPageList的bean,就是啦。