Pessoal.
Tenho o seguinte hbm:
<hibernate-mapping>
<class name="br.com.bvti.ep.model.to.CategoryldfTO" table="TCATEGORYLDF" schema="dbo" catalog="EP5">
<composite-id name="id" class="br.com.bvti.ep.model.to.CategoryldfIdTO">
<key-property name="categoryUid" type="long">
<column name="CATEGORY_UID" />
</key-property>
<key-property name="locale" type="string">
<column name="LOCALE" length="20" />
</key-property>
</composite-id>
<many-to-one name="tcategory" class="br.com.bvti.ep.model.to.CategoryTO" update="false" insert="false" fetch="select">
<column name="CATEGORY_UID" not-null="true" />
</many-to-one>
<property name="url" type="string">
<column name="URL" />
</property>
<property name="keyWords" type="string">
<column name="KEY_WORDS" />
</property>
<property name="description" type="string">
<column name="DESCRIPTION" />
</property>
<property name="title" type="string">
<column name="TITLE" />
</property>
<property name="displayName" type="string">
<column name="DISPLAY_NAME" not-null="true" />
</property>
</class>
</hibernate-mapping>[/code]
Não sei como tratar o composite id, visto que eu precisaria do atributo: [b]categoryUid[/b]
Mas no meu DAO eu fiz o seguinte select:
[code] public static final String CATEGORY_SELECT_ALL = " select b.displayName from CategoryTO as a, CategoryldfTO as b" +
" where b.id.categoryUid = a.uidpk" +
" and a.endDate is null";
E quando tento executar a seguinte excessão é lançada:
java.lang.ClassCastException
at br.com.bvti.util.service.ServiceBaseImpl.buildTopMenu(ServiceBaseImpl.java:81)
at br.com.bvti.ep.web.action.HomeAction.perform(HomeAction.java:48)
at org.apache.struts.action.Action.execute(Action.java:420)
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.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
Alguem teria alguma solucao q poderia me ajudar?
Abs´s
:D:D:D:D:D