-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: hibernate join??
PostPosted: Wed Sep 15, 2004 4:02 am 
Newbie

Joined: Wed Sep 15, 2004 3:44 am
Posts: 1
Hibernate2.jar

MstSeth.hbm.xml&MstSetd.hbm.xml
MstSetd.hbm.xml:
...
<class
name="jp.co.liondor.common.database.mstSET.MstSetd"
table="M043_SETD"
>
<composite-id name="mstSetdPK" class="jp.co.liondor.common.database.mstSET.MstSetdPK">
<key-property
name="kjoKmkCd"
column="KJO_KMK_CD"
type="java.lang.String"
/>
<key-property
name="grpCd"
column="GRP_CD"
type="java.lang.String"
/>
<!-- bi-directional many-to-one association to MstSeth -->
<!--
<key-many-to-one
name="mstSeth"
class="jp.co.liondor.common.database.mstSET.MstSeth"
>
<column name="GRP_CD" />
</key-many-to-one>
-->
</composite-id>
...
MstSeth.hbm.xml:
...
<class
name="jp.co.liondor.common.database.mstSET.MstSeth"
table="M042_SETH"
>

<id
name="grpCd"
type="java.lang.String"
column="GRP_CD"
>
<generator class="assigned" />
</id>
...

Code between sessionFactory.openSession() and session.close():
String hql = "from MstSeth seth full inner join MstSetd setd on
seth.grpCd=setd.mstSetdPK.grpCd";
try
{
Session session = getSession();
Query q = session.createQuery(hql);
List list = q.list();
if (!list.isEmpty())
{
return list;
}
}
catch (HibernateException e)
{
throw new DataAccessException(e);
}

Full stack trace of any exception that occurs:
14:34:46,796 ERROR [http-8080-Processor21] LoggingExceptionHandler.java:46 - エラー発生
14:34:46,828 ERROR [http-8080-Processor21] LoggingExceptionHandler.java:49 - jp.co.m_stone.application.database.DataAccessException: net.sf.hibernate.QueryException: unexpected token: inner [from jp.co.liondor.common.database.mstSET.MstSeth seth full inner join MstSetd setd on seth.grpCd=setd.mstSetdPK.grpCd]
at jp.co.liondor.common.database.mstSET.MstSetDAOImpl.findByLower(MstSetDAOImpl.java:191)
at jp.co.liondor.kaikei.fc00.fc15TaiPrt.business.TaiPrt.getSetDTO(TaiPrt.java:52)
at jp.co.liondor.kaikei.fc00.fc15TaiPrt.business.TaiPrtDelegate.getSetDTO(TaiPrtDelegate.java:44)
at jp.co.liondor.kaikei.fc00.fc15TaiPrt.presentation.TaiPrtSupport.createData(TaiPrtSupport.java:135)
at jp.co.liondor.common.report.presentation.ReportActionSupport.doCreate(ReportActionSupport.java:93)
at jp.co.liondor.common.report.presentation.ReportAction.executeLogic(ReportAction.java:135)
at jp.co.m_stone.application.presentation.common.action.MsBaseAction.execute(MsBaseAction.java:198)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at jp.co.m_stone.application.presentation.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:61)
at jp.co.m_stone.application.presentation.util.SetCharacterEncodingFilterTomcat5.doFilter(SetCharacterEncodingFilterTomcat5.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Thread.java:534)
Caused by: net.sf.hibernate.QueryException: unexpected token: inner [from jp.co.liondor.common.database.mstSET.MstSeth seth full inner join MstSetd setd on seth.grpCd=setd.mstSetdPK.grpCd]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:77)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:293)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1554)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1525)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at jp.co.liondor.common.database.mstSET.MstSetDAOImpl.findByLower(MstSetDAOImpl.java:182)
... 40 more
Name and version of the database you are using:
Sybase: ase1251dev_nt
The generated SQL (show_sql=true):
from jp.co.liondor.common.database.mstSET.MstSeth seth full inner join MstSetd setd on seth.grpCd=setd.mstSetdPK.grpCd
Debug level Hibernate log excerpt:
i don't know


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 15, 2004 7:42 am 
Regular
Regular

Joined: Mon Oct 06, 2003 7:17 am
Posts: 58
Location: Switzerland
Code:
from MstSeth seth full inner join MstSetd setd on seth.grpCd=setd.mstSetdPK.grpCd


For what is "full" standing? Try it without.

Reto


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.