excel导出时要导入其他对象的内容,可以再对象和配置文件中更改
cccc
private String infotxt;
private String resulttype;
public String getResulttype() {
return resulttype;
}
public void setResulttype(String resulttype) {
this.resulttype = resulttype;
}
public String getInfotxt() {
return infotxt;
}
public void setInfotxt(String infotxt) {
this.infotxt = infotxt;
}
Maint.hbm.xml
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated Oct 22, 2012 2:48:57 PM by Hibernate Tools 3.4.0.CR1 --> <hibernate-mapping> <class name="cn.main.Maint" table="maint" > <id name="mid" type="int"> <column name="mid"/> <generator class="identity" /> </id> <property name="sid" type="string"> <column name="sid" length="10"/> </property> <property name="ramid" type="string"> <column name="ramid" length="20"/> </property> </property> <property name="postcode" type="string"> <column name="postcode" length="6" /> </property> 这是关键! <property name="infotxt" formula="(select p.fillInfo from payer p where p.orderNum=ramid)"> </property> <property name="resulttype" formula="(select p.restype from payer p where p.orderNum=ramid)"> </property> </class> </hibernate-mapping>