[Persistence, JBoss/CMP, Hibernate, Database] - EJBQL Query Question
by f.ulbricht@qualitype.de
I have two entities, a Company and an Address. The Company has two addresses, the mainAdrress that is required and the postalAddress that is optional (both configured as OneToOne). Now I need a list with all my companies and their city names for both addresses. I use this query:
| SELECT
| c.displayName,
| c.mainAddress.city,
| c.postalAddress.city
| FROM
| Company c
|
Hibernate is translating this query to SQL:
| select
| companyent0_.displayName as col_0_0_,
| addressent1_.city as col_1_0_,
| addressent2_.city as col_2_0_
| from
| Company companyent0_,
| Address addressent1_,
| Address addressent2_
| where
| companyent0_.mainAddress_primaryKey=addressent1_.primaryKey
| and companyent0_.postalAddress_primaryKey=addressent2_.primaryKey
|
The effect is, that only those companies having both addresses set will be returned. Looking at the SQL statement I understand why. Nevertheless, how can I create a query that will return NULL for the second city name if the company does not have such an address? Can this be done using a special query syntax or do I have to configure the relations between the entities in another way?
Thanks to anyone that can help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085019#4085019
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085019
18 years, 9 months
[JBoss Messaging] - Failed to deliver the message to the client. See the server
by Craig2007
Hi
We are using JBoss Messaging Server.In Prod Enironment , we get the following exception sometimes.
|
| 2007-09-17 16:37:49,437 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] java.net.NoRouteToHostException: No route to host
| 2007-09-17 16:37:52,439 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] java.net.NoRouteToHostException: No route to host
| 2007-09-17 16:37:52,440 WARN [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] Failed to deliver the message to the client. See the server log for more details.
| 2007-09-17 16:37:52,440 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483587] failed to deliver the message to the client.
| org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for locator - InvokerLocator [socket://10.0.34.113:3730/?dataType=jms&marshaller=org.jboss.jms.server.remoting.JMSWireFormat&serializationType=jboss&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat]
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java(Compiled Code))
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java(Compiled Code))
| at org.jboss.remoting.Client.invoke(Client.java(Compiled Code))
| at org.jboss.remoting.Client.invoke(Client.java(Inlined Compiled Code))
| at org.jboss.remoting.Client.invoke(Client.java(Inlined Compiled Code))
| at org.jboss.jms.server.endpoint.ServerConsumerEndpoint$Deliverer.run(ServerConsumerEndpoint.java(Compiled Code))
| at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java(Compiled Code))
| at java.lang.Thread.run(Thread.java:567)
| Caused by: java.net.NoRouteToHostException: No route to host
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java(Compiled Code))
| at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java(Compiled Code))
| at java.net.PlainSocketImpl.connect(PlainSocketImpl.java(Compiled Code))
| at java.net.Socket.connect(Socket.java(Compiled Code))
| at java.net.Socket.connect(Socket.java(Inlined Compiled Code))
| at java.net.Socket.<init>(Socket.java(Compiled Code))
| at java.net.Socket.<init>(Socket.java(Inlined Compiled Code))
| at org.jboss.remoting.transport.socket.SocketClientInvoker.createSocket(SocketClientInvoker.java(Compiled Code))
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java(Compiled Code))
| ... 8 more
|
|
Basically can anyone tell me what wud be reason for this type of exception ....
I need the cause for this exception ...
Looking forward the valuable response.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085010#4085010
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085010
18 years, 9 months