我有问题通过D_TRANSAKSI选择数据。 这是我的疑问:
String SQL = "SELECT a.zip_file_name, a.ltkl_count, a.ltkl_count_process, b.status, a.sent_date, a.receive_date" +
" FROM t_ltkl_submit_info a" +
" JOIN t_ltkl_submit_info_det b" +
" ON a.id = b.id_submit_info" +
" JOIN t_ltkl c" +
" ON a.zip_file_name = c.zip_file_name" +
" JOIN t_kupu_in d" +
" ON c.id_kupu_incoming = d.id_kupu_incoming" +
" JOIN t_kupu_in_transaksi e" +
" ON d.id_kupu_incoming = e.id_kupu_incoming" +
" WHERE e.d_transaksi = :d_transaksi";
SQLQuery query = getSession().createSQLQuery(SQL);
query.setParameter("d_transaksi", d_transaksi);
实体的别名:
query.addEntity("a", LtklSubmitInfo.class);
query.addEntity("b", LtklSubmitInfoDetail.class);
query.addEntity("c",TLtkl.class);
query.addEntity("d", TKupuIncoming.class);
query.addEntity("e", TKupuIncomingTransaksi.class);
对于联接表:
query.addJoin("a", "b.LtklSubmitInfo");
query.addJoin("a", "c.LtklSubmitInfo");
query.addJoin("c", "d.TLtkl");
query.addJoin("d", "e.TKupuIncoming");
结束错误是:
org.hibernate.QueryException:无法解析属性:LtklSubmitInfo:gov.siapuppatk.model.LtklSubmitInfoDetail org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:44) org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) org.hibernate.persister.entity.AbstractEntityPersister.getPropertyType(AbstractEntityPersister.java:3439) org.hibernate.loader.custom.CustomLoader。(CustomLoader.java:151) org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1688) org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152) gov.siapuppatk.dao.impl.LtklSubmitInfoDaoImpl.setDataTanggalTransaksi(LtklSubmitInfoDaoImpl.java:149) gov.siapuppatk.service.LtklSubmitInfoService.loadDataTanggalTransaksi(LtklSubmitInfoService.java:133) gov.siapuppatk.service.LtklSubmitInfoService $$ FastClassByCGLIB $$ d8bedee7.invoke() org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) org.springframework.aop.framework.CglibAopProxy $ CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:701) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) org.springframework.transaction.interceptor.TransactionInterceptor $ 1.proceedWithInvocation(TransactionInterceptor.java:96) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.CglibAopProxy $ DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:634) gov.siapuppatk.service.LtklSubmitInfoService $$ EnhancerByCGLIB $$ 45417895.loadDataTanggalTransaksi() gov.siapuppatk.controller.CekSubmitController.viewHistoryLtkl(CekSubmitController.java:127) sun.reflect.NativeMethodAccessorImpl.invoke0(原生方法) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
这是我的控制者:
if (tdate != null){
if (!tdate.equals("")){
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
//tanggalTransaksi = StringHelper.toDate(tdate);
tanggalTransaksi = dateFormat.parse(tdate);
System.out.println("tanggal nih keluar dong " + tanggalTransaksi);
LtklSubmitInfoDto ltklsubmitDto = null;
ltklsubmitDto = this.ltklSubmitInfoService.loadDataTanggalTransaksi(filter,tanggalTransaksi);
}
model.addObject("tdate", tanggalTransaksi);
这是我的服务:
public LtklSubmitInfoDto loadDataTanggalTransaksi (FilterCriteria filterCriteria, Date dTransaksi){
System.out.println("select data by d_transaksi");
LtklSubmitInfoDto ltklSubmitDto = new LtklSubmitInfoDto();
ltklSubmitDto.setdTransaksi((Date) ltklSubmitInfoDao.setDataTanggalTransaksi(dTransaksi));
return ltklSubmitDto;
}
这是我的JSP:
<label style="display: inline-block; width:100px;">Tanggal Transaksi</label>
<lable style="display: inline-block; width:10px;">:</lable>
<input type="text" size="10" name="tdate" id="dateValue3" placeholder="dd/MM/yyyy" value="<fmt:formatDate value="${tanggalTransaksi}" pattern='dd/MM/yyyy'/>" />
<img id='datepick3' src="assets/ico/calendar.png"/>
<br/>
我试图修复它,但它没有解决。
提前致谢