[JBoss-user] [EJB 3.0] - Re: EJB-QL query on partial part of a compound key
answering my own question. Using an alternate annotation approach (@IdClass instead of @Embedded in the PK class and @EmbeddedId in the main class) works as you have to duplicate the compound primary key members in both the PK and the main Entity bean. The EM query can now recognize the key members. You loose the convenience of the PK mechanism, but it works. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919940#3919940 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919940 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: composite PK/FK
So, for further enlightenment could you provide a code snippet of a stateless session bean that contains a method for returning a list of regions from a specific country code? A partial compound key lookup. I have never gotten one of those to work. Thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919936#3919936 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919936 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - EJB-QL query on partial part of a compound key
I cannot seem to get the syntax down here. I have a compound primary defined something like this: @Entity @Table(name = "Person") public class Person implements Serializable { PersonPk pk; . . . @EmbeddedId({ @AttributeOverride(name=?ssn?), @AttributeOverride(name=?tshirtsize?)}) public PersonPK getPk() { return pk; } @Embeddable public class PersonPK implements Serializable { private String ssn; private String tshirtsize; ... } But when I go to do a query on the leading field of the compound key, in this case to get all the tshirtsizes associated with a specific ssn in a query like: public @Stateless class PersonEJBBean implements PersonEJB { @PersistenceContext (unitName = "Personnel") protected EntityManager vEm; List getTshirtsizeBySsn (long ssn) { List ssnList = Em.createQuery("from Person p where p.ssn = :Ssn) .setParameter("Ssn", new Long(ssn)) .getResultList(); . . . I get an InvocationException the states: could not resolve property: ssn of Person [from Person p where ..] ? I've tried everything I can think of to execute a query on the leading part of a compound key, but cannot seem to come up with an acceptable syntax. Any ideas? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919935#3919935 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919935 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JNDI/Naming/Network] - Re: Failed EJB3 JNDI lookup.
Answering my question, but I've got it working now. Things are a bit pickier now in the way one passes a method call via the Proxy now. The code I was using before to call a method taking no parameters was : InitialContext ctx = new InitialContext(); Object obj = ctx.lookup(invokeObj.getClassName()); return(obj.getClass().getMethod("methodName",class[0]{void.class}).invoke(obj,Object[] {})); For whatever reason that seemed to work, but the class[0]{void.class} is bad unless the method declaration in the EJB is explicitly methodName(void);?? How odd is that? So if you have methodName() remove the void.class from the getMethod call and leave it just {}. Duh The ProxyDeployer can now find the method. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3905673#3905673 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3905673 --- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JNDI/Naming/Network] - Re: Failed EJB3 JNDI lookup.
Actually, it is the FIRST ProxyDeployer message that looks supicious, the one about no declared remote bindings View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3905668#3905668 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3905668 --- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JNDI/Naming/Network] - Failed EJB3 JNDI lookup.
This used to work just fine but I am suddenly getting a very odd NoSuchMethodException: java.lang.NoSuchMethodException: $Proxy76.getValidTerrainTypes(void) $Proxy76 is supposed to be TerrainEJB (an EJB3 bean that returns valid terrain types for a mapping application). This is caused by a SWT based client trying invokde the remote EJB3 interface method via a Servlet in a mapping ear application deployed to a JBOSS4.0.3SP1 server. Here is snippet from the bean: @Remote public interface TerrainEJB { public ArrayList getValidTerrainTypes(); } The TerrainEJBBean has the actual method. It returns an ArrayList. The client is an SWT GUI that invokes a Servlet on the JBOSS AS which in turn does the usual JNDI lookup stuff(hard coded strings are actually variables containing the strings...shown for clarity of the problem): InitialContext vCtx = new InitialContext(); Object vObj = vCtx.lookup("constants.ejb.TerrainEJB"); return(vObj.getClass().getMethod( "getValidTerrainTypes" ,Class[0](void) ).invoke( vObj ,null )); Which results in the error. JBOSS initialization of the .ear containing the EJB3 beans shows this: 13:20:59,000 INFO [SessionFactoryImpl] Checking 0 named queries 13:20:59,000 INFO [Ejb3Deployment] Create EntityManager with JNDI name: MapEdit 13:20:59,015 INFO [JaccHelper] JACC Policy Configuration for deployment has been put in service 13:20:59,015 INFO [Ejb3Deployment] EJB3 deployment time took: 1828 13:20:59,109 INFO [ProxyDeployer] no declared remote bindings for : constants.ejb.TerrainEJBBean 13:20:59,125 INFO [ProxyDeployer] there is remote interfaces for constants.ejb.TerrainEJBBean 13:20:59,125 INFO [ProxyDeployer] default remote binding has jndiName of constants.ejb.TerrainEJB The second ProxyDeployer message looks suspicious... This code is a veritable copy of some JBOSS example code, LightMinds appletService example (which now suffers from the same error!). View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3905667#3905667 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3905667 --- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user