-->
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.  [ 4 posts ] 
Author Message
 Post subject: The tag join works in Hibernate 3.0.5?
PostPosted: Fri Nov 04, 2005 12:59 pm 
Newbie

Joined: Fri Nov 04, 2005 12:51 pm
Posts: 5
Hi! I was looking after a solution to a problem that i'm having. I've been looking for into these pages:

http://forum.hibernate.org/viewtopic.php?t=937111
http://opensource2.atlassian.com/projec ... se/HHH-551

http://forum.hibernate.org/viewtopic.ph ... join+table


They all tell me that the tag join ins't implemented.

Is that correct?


Thanks in advance.


This is how i'm using the join tag:


<join table="TBSMS_TIPO_ARQ" column="id_tipo_arq">
<key column="id_tipo_arq" />
<property name="tipoLayout" column="ds_desc" />
</join>


And this is the error:

br.com.netservicos.jnet.exception.JNetException: java.rmi.RemoteException: EJB Exception: ; nested exception is:
Initialization of bean failed; nested exception is org.hibernate.MappingException: invalid mapping
at br.com.netservicos.jnet.delegate.GenericBusinessDelegate.executeMethod(GenericBusinessDelegate.java:155)
at br.com.netservicos.jnet.delegate.GenericBusinessDelegate.execute(GenericBusinessDelegate.java:95)
at br.com.netservicos.jnet.base.BaseAction.executeDelegate(BaseAction.java:62)
at br.com.netservicos.sms.fatcobranca.webapp.action.ControlaLogArquivosAction.selecionaListaLogArquivos(ControlaLogArquivosAction.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at br.com.netservicos.jnet.base.BaseAction.execute(BaseAction.java:126)
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:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 1:31 am 
Regular
Regular

Joined: Fri Nov 07, 2003 6:31 am
Posts: 104
Location: Beijing, China
Hi,
you're not suppose to have a column attribute in your <join> element.
the <key element is supposed to hold this information and your already filled it.

rgds,

_________________
/nodje


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 8:54 am 
Newbie

Joined: Fri Nov 04, 2005 12:51 pm
Posts: 5
Hi! Thanks for your reply.

So it is possible to use the tag "join". It was implemented, right? Great!
But i didn't understand how i should get the "ds_desc" value in my "TBSMS_TIPO_ARQ" table using this tag. May you show me how?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 12:58 am 
Regular
Regular

Joined: Fri Nov 07, 2003 6:31 am
Posts: 104
Location: Beijing, China
Quote:
i didn't understand how i should get the "ds_desc" value in my "TBSMS_TIPO_ARQ" table using this tag


I'm sorry, I don't quite get your point.

<join> is generally used when you have an optional one-to-one mapping.
For instance the adresse of a personne.

It allows you to map 2 or more tables to one class.
Hibernate will automatically create a row in the join table when you save a main class instance with value for the <join attributes.

something like that: You have one object Person and it's address info are optional:

<class name="person" table="PERSON">
<id column="person_id">
<prop...

<join table="ADDRESS">
<key column"ADDRESS_PERSON_ID_FK">
<property column="ADDRESS_POSTCODE" ...
</join>

You have to have the second table reference the PK of the first one.

_________________
/nodje


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.