[EJB 3.0] - Misunderstanding SqlResultSetMapping
by kpiis
I'm trying to write nativeQuery which should returns result in 2 enitities:
A & B. There are a lot of fields in each entity.
@SqlResultSetMapping(name="BLABLABLA",
entities={(a)EntityResult(entityClass=A.class,
fields={@FieldResult(name="aid",
column="aid")}
),
@EntityResult(entityClass=B.class,
fields={@FieldResult(name="bid",
column="bid")}
)})
My questions are:
should I put all fields in @FieldResult anotations, if I am interested in only in primary keys of 2 entities?
If I want receive additional fields - Have I to add these fields to @FieldResult?
And now I have trouble with my native query:
Entity A have realtion with another entity C (type one2one, PK of another entity are saved in A table) and when query is executed - the Hibernate throws errors, that it cannot read the property C. What is the problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048386#4048386
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048386
18 years, 11 months
[Installation, Configuration & Deployment] - Re: NetBeans and JBoss 4.2.0 problem?
by spirosmichalak
Hello,
The proper way is click on 'Runtime' tab, expand 'Servers' and look at your JBoss server icon. It should have a little green arrow in the bottom right corner when it's running, an orangey type box/arrow when it's running in debug mode and nothing when it's not running.
If it's running and you right click on it you should be able to select 'Stop' from the drop down list.
But, there are two problems. Sometimes the green arrow doesn't appear, i.e. NetBeans doesn't know JBoss is running, and other times it does appear, but when you select 'Stop', it keeps trying, but never succeeds in stopping it!
So, what I do is go into the Task Manager and select the appropriate java.exe process that's running and 'End Process'! How do you know which java.exe is JBoss? You might have to experiment with this, but when I'm running only NetBeans and JBoss, NetBeans (also a java.exe process) takes up roughly 150-250K memory, while JBoss around half that!
If anyone knows of a better way, please let me know as well.
Good luck,
Spiros
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048385#4048385
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048385
18 years, 11 months
[Management, JMX/JBoss] - Local JNDI lookup in local JMX bean?
by nappinc
I have a J2EE 1.4 web application (a single .war packaged in a single .ear) that contains includes both Web Service client code and some JMX beans. I can successfully invoke the web service in the web app via a JNDI lookup, but when invoking the web service from one of the JMX beans (via the JBoss Web Console) JNDI lookup fails with "service not bound".
My service reference (in web.xml) is as follows:
<service-ref>
| <description>Web Service Client</description>
| <service-ref-name>service/GMS</service-ref-name>
| <service-interface>javax.xml.rpc.Service</service-interface>
| <wsdl-file>WEB-INF/wsdl/gms.wsdl</wsdl-file>
| <jaxrpc-mapping-file>WEB-INF/gms-mapping.xml</jaxrpc-mapping-file>
| <service-qname xmlns:tns="http://..snip../gms">tns:GMS</service-qname>
| </service-ref>
And my JNDI lookup is as follows:
Context context = new InitialContext();
| Service service = (Service) context.lookup("java:comp/env/service/GMS");
The lookup code is called both from JMX and from code invoked by a servlet. In the servlet the lookup works, but in JMX the lookup fails.
We're using JBoss 4.0.4, Java 1.4.2, and Spring 1.2.5 to handle publishing the JMX MBeans.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048380#4048380
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048380
18 years, 11 months
[JBoss Seam] - Re: Newbei question: Page navigation
by zwu_ca
First I am so thankful you are so patient and so willing to help -- very rarely.
I don't see 'a' anywhere in the original code posting. I forgot to use the 'code' html tag in the original code. There might be some confusion there (you might have different views from mine?). I will try to post the code again here (hopefully this time it can be resolved ).
|
| <page view-id="/home.xhtml">
|
| <navigation>
| <rule if="#{identity.loggedIn}">
| <redirect view-id="/itemlist.xhtml"/>
| </rule>
| </navigation>
|
| </page>
| <page view-id="/itemlist.xhtml" login-required="true" >
| <param name="id" value="#{itemlist.me}" />
| <navigation from-action="#{hotelBooking.cancel}">
| <redirect view-id="/main.xhtml"/>
| </navigation>
| </page>
|
| import javax.ejb.*;
| /**
| *
| * @author WuZX
| */
| @Local
| public interface Itemlist
| {
| UploadedData getData();
| String getMe();
| void setMe(String me);
| /*
| public void setDamn(String id);
| public String getDamn();
| */
| public void destroy();
|
| }
|
|
|
| /**
| *
| * @author WuZX
| */
| import static org.jboss.seam.ScopeType.STATELESS;
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.RequestParameter;
| import org.jboss.seam.annotations.Create;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.Scope;
| import javax.ejb.Remove;
| import javax.ejb.*;
| import static org.jboss.seam.ScopeType.*;
|
| import org.jboss.logging.Logger;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
|
| @Stateful
| @Name("itemlist")
| @Scope(EVENT)
| public class ItemlistAction implements Itemlist {
|
| //@In String id;
|
| // private UploadedData uploadedData;
|
| @PersistenceContext
| private EntityManager em;
|
|
| @RequestParameter("id")
| private String me;
|
| private static final Logger log = Logger.getLogger(ItemlistAction.class);
| static
| {
| log.info("loading?****************");
| }
|
| /*public String getData()
| {
|
| return "data" + id;
| }*/
| //@Out
| //@Factory("uploadedData")
| public UploadedData getData()
| {
| log.info("get here" + me);
|
| if (me == null )
| {
| //UploadedData uploadedData = new UploadedData();
| //uploadedData.setTesting("testing");
| return null;
| }
| return em.find(UploadedData.class, new Long(me));
|
| }
|
| public String getMe()
| {
| log.info("===============get me " + me);
|
| return me;
| }
|
| public void setMe(String me)
| {
| log.info("================= set me here" + me);
|
| this.me = me;
| }
| public int getDataID()
| {
| return 3;
| /* try
| {
| if (id != null)
| return Integer.parseInt(id);
| }
| catch(Exception e)
| {
|
| }
| return 0;
| */
| }
|
| @Destroy @Remove
| public void destroy() {}
| }
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048362#4048362
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048362
18 years, 11 months