i have a set in sysuser table mapping files.
<set name="usertofunc" table="USERTOFUNC" lazy="true" inverse="true" outer-join="true">
<key column="EMPSEQNO"/>
<composite-element class="com.capinfo.ems.login.dao.hibernate.Usertofunc">
<many-to-one name="sysmenu" class="com.capinfo.ems.login.dao.hibernate.Sysmenu" column="FUNCID" outer-join="auto"/>
<property column="SDATE" length="7" name="sdate" type="java.util.Date"/>
<property column="EDATE" length="7" name="edate" type="java.util.Date"/>
</composite-element>
</set>
it goes well but when i query the data
select elements(sysuser.usertofunc) from .Sysuser sysuser where sysuser.empname=:empname
the code is:
List list=sdi.getFuncByName(sysuserbyid.getEmpname());
Iterator iter=list.iterator();
while(iter.hasNext()) {
Usertofunc uf=(Usertofunc) iter.next();
System.out.println(uf.getFuncid());
}
it is no exception but can not get the data
19:40:52,702 DEBUG Printer:75 - listing entities:
19:40:52,712 DEBUG Printer:82 - com.capinfo.ems.login.dao.hibernate.Sysmenu{memo=null, funcid=B120, funcname=修改立项申请}
19:40:52,712 DEBUG Printer:82 - com.capinfo.ems.login.dao.hibernate.Sysuser{usertofunc=[Usertofunc{sysmenu=Sysmenu#B120, edate=null, sdate=null}], pubickey=0, memo=null, validtag=null, userstate=0, lossdate=null, empname=test, avlsdate=01 四月 2004 00:00:00, empid=1, empseqno=1, avledate=null, pwd=1}
19:40:52,712 DEBUG Printer:82 - com.capinfo.ems.login.dao.hibernate.Sysmenu{memo=null, funcid=B430, funcname=投标结果记录}
19:40:52,722 DEBUG Printer:82 - com.capinfo.ems.login.dao.hibernate.Sysmenu{memo=null, funcid=B520, funcname=项目周报查询}
19:40:52,722 DEBUG Printer:82 - com.capinfo.ems.login.dao.hibernate.Sysmenu{memo=null, funcid=B130, funcname=立项申请审批}
19:40:52,722 DEBUG Printer:82 - com.capinfo.ems.login.dao.hibernate.Sysmenu{memo=null, funcid=B210, funcname=销售项目周报}
19:40:52,732 DEBUG SessionImpl:2323 - executing flush
19:40:52,732 DEBUG SessionImpl:2790 - post flush
null
null
null
null
null
[com.capinfo.ems.login.dao.hibernate.Usertofunc@3257b8[empseqno=0,funcid=<null>], com.capinfo.ems.login.dao.hibernate.Usertofunc@11d2572[empseqno=0,funcid=<null>], com.capinfo.ems.login.dao.hibernate.Usertofunc@859a68[empseqno=0,funcid=<null>], com.capinfo.ems.login.dao.hibernate.Usertofunc@15c62bc[empseqno=0,funcid=<null>], com.capinfo.ems.login.dao.hibernate.Usertofunc@5660d6[empseqno=0,funcid=<null>]]
|