Foros de discusión
Ext, build-ejb, portal-ejb question
portal2poe portal2poe, modificado hace 19 años.
Ext, build-ejb, portal-ejb question
Junior Member Mensajes: 56 Fecha de incorporación: 18/08/04 Mensajes recientes
Hiya everyone,<br /><br />Forums look great Brian!<br /><br />Using eclipse (which is great!!!) I'm working with build-ejb in the extension environment, and am working on building a portlet with similar functionality to the <br />"projects" portlet. I need to do a join with the User_ table, so looking around in portal-ejb, found a couple examples (Project, Addressbook, BibleJournal)<br /><br />Looking at the ejb.xml in portal-ejb/projects, you'll notice the following line (circa 66-68):<br /><br /><!-- Relationships --><br /><br /> <column name="users" type="Collection" ejb="com.liferay.portal.User" mapping-table="Users_ProjProjects" /><br /><br /><br />This produces all the EJB code, and creates a JOIN in the Persistence file associated with this EJB. <br /><br />When I move this same line of code to ejb.xml in the extension environment, I get this error:<br /><br /> [java] java.io.FileNotFoundException: C:\Eclipse\workspace\portal\ext\ext-ejb\src\com\liferay\portal\ejb.xml (The system cannot find the path specified)<br /> <br />So my question: Can I make a copy of portal-ejb/src/com/liferay/portal/ejb.xml and plop (plop being a technical term <!--emo&--><img src='@theme_images_path@/emotions/tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif' /><!--endemo--> ) it into ext-ejb/src/com/liferay/portal/ ??, or will this cause unintended problems? And if I can't do it that way, what's a recommended fix?
Brian Chan, modificado hace 19 años.
Ext, build-ejb, portal-ejb question
Liferay Master Mensajes: 753 Fecha de incorporación: 5/08/04 Mensajes recientes
Hmm.. yes, you understand what's happening. I'd go ahead and try putting the ejb.xml there. It shouldn't cause too many problems. The ext way was never tested with many to many relationships with the User ejb.xml.<br /><br />I'd love to know what happens!
portal2poe portal2poe, modificado hace 19 años.
Ext, build-ejb, portal-ejb question
Junior Member Mensajes: 56 Fecha de incorporación: 18/08/04 Mensajes recientes
I just realized I was doing something dumb, so I'm recanting what was just here. Hold on while I check it.
Brian Chan, modificado hace 19 años.
Ext, build-ejb, portal-ejb question
Liferay Master Mensajes: 753 Fecha de incorporación: 5/08/04 Mensajes recientes
If you use the build.xml from ext-ejb, it should have a reference to portal-ejb.jar. So it's the Eclipse environment that doesn't have access to it. I'm not sure how you'd set that up though (since I only use EditPlus).
portal2poe portal2poe, modificado hace 19 años.
Ext, build-ejb, portal-ejb question
Junior Member Mensajes: 56 Fecha de incorporación: 18/08/04 Mensajes recientes
You're too fast!!! lol.<br /><br />You're right...in response to the post you read before I nerfed it, eclipse does have access to portal-ejb. But I didn't include this in my ejb.xml:<br /><br /><reference package-path="com.liferay.portal" ejb="User" /><br /><br /><br />so when I tried to deply, the compiler couldn't find com.liferay.portal because it wasn't imported (so once I fixed that, everything compiled beautifully)! <br /><br />So I think, generally, you are able to do a join of a Hibernate HBMl from the ext environment into a HBM in the portal-ejb, it just takes a llittle finangling.