TblFwxx
[code="java"]
package com.accp.myhouse.pojo;
import java.util.Date;
/**
- TblFwxx entity.
- @author MyEclipse Persistence Tools */
public class TblFwxx implements java.io.Serializable {
// Fields
private Integer fwid;
private TblJd tblJd;
private TblFwlx tblFwlx;
private TblUser tblUser;
private Integer shi;
private Integer ting;
private String fwxx;
private Double zj;
private String title;
private Date date;
private String telephone;
private String lxr;
private Double zjLow;
private Double zjHigh;
private Date startDate;
// Constructors
/** default constructor */
public TblFwxx() {
}
/** minimal constructor */
public TblFwxx(TblJd tblJd, TblFwlx tblFwlx, TblUser tblUser) {
this.tblJd = tblJd;
this.tblFwlx = tblFwlx;
this.tblUser = tblUser;
}
/** full constructor */
public TblFwxx(TblJd tblJd, TblFwlx tblFwlx, TblUser tblUser, Integer shi,
Integer ting, String fwxx, Double zj, String title, Date date,
String telephone, String lxr) {
this.tblJd = tblJd;
this.tblFwlx = tblFwlx;
this.tblUser = tblUser;
this.shi = shi;
this.ting = ting;
this.fwxx = fwxx;
this.zj = zj;
this.title = title;
this.date = date;
this.telephone = telephone;
this.lxr = lxr;
}
// Property accessors
public Integer getFwid() {
return this.fwid;
}
public void setFwid(Integer fwid) {
this.fwid = fwid;
}
public TblJd getTblJd() {
return this.tblJd;
}
public void setTblJd(TblJd tblJd) {
this.tblJd = tblJd;
}
public TblFwlx getTblFwlx() {
return this.tblFwlx;
}
public void setTblFwlx(TblFwlx tblFwlx) {
this.tblFwlx = tblFwlx;
}
public TblUser getTblUser() {
return this.tblUser;
}
public void setTblUser(TblUser tblUser) {
this.tblUser = tblUser;
}
public Integer getShi() {
return this.shi;
}
public void setShi(Integer shi) {
this.shi = shi;
}
public Integer getTing() {
return this.ting;
}
public void setTing(Integer ting) {
this.ting = ting;
}
public String getFwxx() {
return this.fwxx;
}
public void setFwxx(String fwxx) {
this.fwxx = fwxx;
}
public Double getZj() {
return this.zj;
}
public void setZj(Double zj) {
this.zj = zj;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public Date getDate() {
return this.date;
}
public void setDate(Date date) {
this.date = date;
}
public String getTelephone() {
return this.telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getLxr() {
return this.lxr;
}
public void setLxr(String lxr) {
this.lxr = lxr;
}
public Double getZjLow() {
return zjLow;
}
public void setZjLow(double zjLow) {
this.zjLow = zjLow;
}
public Double getZjHigh() {
return zjHigh;
}
public void setZjHigh(double zjHigh) {
this.zjHigh = zjHigh;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
}
[/code]
TblJd
[code="java"]
package com.accp.myhouse.pojo;
import java.util.HashSet;
import java.util.Set;
/**
- TblJd entity.
- @author MyEclipse Persistence Tools */
public class TblJd implements java.io.Serializable {
// Fields
private Integer jdid;
private TblQx tblQx;
private String jd;
private Set tblFwxxes = new HashSet(0);
// Constructors
/** default constructor */
public TblJd() {
}
/** minimal constructor */
public TblJd(TblQx tblQx, String jd) {
this.tblQx = tblQx;
this.jd = jd;
}
/** full constructor */
public TblJd(TblQx tblQx, String jd, Set tblFwxxes) {
this.tblQx = tblQx;
this.jd = jd;
this.tblFwxxes = tblFwxxes;
}
// Property accessors
public Integer getJdid() {
return this.jdid;
}
public void setJdid(Integer jdid) {
this.jdid = jdid;
}
public TblQx getTblQx() {
return this.tblQx;
}
public void setTblQx(TblQx tblQx) {
this.tblQx = tblQx;
}
public String getJd() {
return this.jd;
}
public void setJd(String jd) {
this.jd = jd;
}
public Set getTblFwxxes() {
return this.tblFwxxes;
}
public void setTblFwxxes(Set tblFwxxes) {
this.tblFwxxes = tblFwxxes;
}
}
[/code]
我用DWR做的AJAX
现在我要根据jdid来查询房屋信息
该怎么办啊?
查询方法的代码如下:
[code="java"]
public int findFwxxTotalNumByCondition(final TblFwxx fwxx) {
return (Integer)getHibernateTemplate().execute(new HibernateCallback(){
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria c = session.createCriteria(TblFwxx.class);
c.setProjection(Projections.count("fwid"));
if(fwxx.getTblJd()!=null){
c.add(Restrictions.eq("tblJd.jdid", fwxx.getTblJd().getJdid()));
}
return c.uniqueResult();
}
});
}
[/code]
任何用DWR调用这样的方法啊?
谢谢各位大大了!
DWR配置文件
[code="XML"]
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<create>
<param name="location" value="applicationContext.xml"></param>
</create>
<create creator="new" javascript="JDate">
<param name="class" value="java.util.Date"/>
</create>
<create creator="new" javascript="Demo">
<param name="class" value="your.java.Bean"/>
</create>
<create creator="spring" javascript="findJd">
<param name="beanName" value="jdService" />
</create>
<create javascript="findFwxx" creator="spring">
<param name="beanName" value="fwxxService"></param>
<include method="findFwxxForPageListByCondition"/>
</create>
<convert converter="bean" match="com.accp.myhouse.pojo.TblJd">
</convert>
<convert converter="bean" match="com.accp.myhouse.pojo.TblFwxx">
</convert>
[/code]