[EJB 3.0] - Re: Etity reference problems
by fhh
Two things:
| public class C {
|
| @Id
| @Column(name = "Aid")
| private Integer id;
|
| @OneToOne
| @JoinColumn(name = "Aid", nullable=false)
| private A a;
|
| @OneToOne
| @PrimaryKeyJoinColumn
| private B b;
|
| ...
| }
|
- This doesn't look good to me. You are mapping the column "Aid" twice.
- If the tuple(a,b) is unique use an @EmbeddedId.
2.) Do you need Class C at all? Simply use a @JoinTable:
| public class A {
|
| @Id
| @GeneratedValue(strategy = GenerationType.IDENTITY)
| @Column(name = "Aid")
| private Integer id;
|
| @OneToMany(cascade = CascadeType.ALL, mappedBy = "A", fetch = FetchType.LAZY)
| private List<B> Bs = new ArrayList<B>();
|
|
| @OneToOne
| @JoinTable(name="C",
| joinColumns=@JoinColumn(name="Aid"),
| inverseJoinColumns=@JoinColumn(name="Bid")
| private B b = null;
|
| ...
| }
|
This will only work if C has some more properties. (And I have never tried a @OneToOne-Relationship using a JoinTable before. YMMV).
Regards
Felix
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033856#4033856
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033856
18 years, 7 months
[Beginners Corner] - Remote access to JBoss
by millerdl
JBoss (v4.0.5) is being used in our project to communicate via JMS as defined by our target platform. We have been running JBoss fine locally using RMI on port 1099 and an internally defined topic. We want to give a third party access to connect to our JBoss. We port forwarded port 1099 thru our gateway but the third party just hangs when they try to use the values we provided. We have also tried using port 8009 which seems to be active from nmap to the machine running JBoss.
1) Is this problem occuring because we have been using the default RMI on our side of the gateway?
2) Do we have to use Uil2 in place of RMI? If so, what do we need to do for that?
3) Is there a simple instruction on JBoss that will explain how to provide external access? The pages I have read so far about remote access and RMI do not make much sense to me due to my low knowledge of JBoss and its functionality.
If this is just a configuration issue I have not seen an explanation that makes sense to me on the jboss.org site or forums.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033855#4033855
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033855
18 years, 7 months
[JBoss Seam] - Re: Bug in explicit conversation id management in SEAM 1.2.1
by raffaele.camanzo
It made me crazy but I found it. It was a problem with my configuration faces-config.xml / pages.xml.
I was doing almost the same thing of the booking sample (booking confirmation) and there I found the solution: I moved the navigation rules in the pages and (I think this is the reason) redirected the requests.
But I'm facing another problem (or I'm doing something else wrong):
In the booking sample language (meaningless for the sample but to show the scenario):
I would like to include the hotel search result list in the template (having it visible also in the booking page) and I would like to select another hotel from the booking, and then start the new conversation having the same view-id, same action but using hotel.id to create different conversation id, through the conversation-param EL).
To achieve this I blocked the conversation propagation in the hotel selection <s:link>, something like this:
| <s:link action="#{myaction.begin}" value="Select It">
| <s:conversationPropagation type="none" />
| </s:link>
|
and configured the pages.xml as follows:
| <pages no-conversation-view-id="/main.xhtml">
| <conversation name="convOne" parameter-name="myactionId" parameter-value="#{myhotel.id}" />
|
| <page view-id="/main.xhtml">
| <navigation from-action="#{myaction.begin}">
| <!-- myaction begin method does not have @Begin annotation -->
| <begin-conversation/>
| <redirect view-id="/myaction.xhtml" />
| </navigation>
| </page>
|
| <page view-id="/myaction.xhtml">
| <navigation from-action="#{myaction.begin}">
| <begin-conversation/>
| <redirect />
| </navigation>
| </page>
|
| </pages>
|
The effect is this:
- the first time everything is ok, conversation started, promoted as a long running and so on...
- when I try to book more than once Seam is unable to recognize (does not evaluate the EL #{myhotel.id}) and assigns a generated id but starts the conversation, promotes it as a long running...
Can I achieve this with explicit natural conversation id? Am I doing something wrong or is a bug?
Regards,
Raffaele Camanzo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033852#4033852
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033852
18 years, 7 months