[JBoss Seam] - EntityQuery restriction help
by dloebbe
Hi all,
after searching the examples, documentation and forum for a solution I can't get the following use case to work:
I like to restrict the EntityQuery for object A by a related Object B. The Entities and search-dialogue are created by seam-gen. But I like to add a simple single select list of object of class b as search criteria.
My code:
| @Entity
| public class A implements Serializable
| {
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| private Long id;
|
| @ManyToOne(fetch = FetchType.EAGER)
| @JoinColumn(name = "bid", nullable = true)
| private B b;
| }
|
| @Entity
| public class B implements Serializable
| {
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| private Long id;
|
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "b")
| private Set<A> as;
| }
|
I like to create an EntityQuery, which searches / returns Objects of class A related to a specific Object of class B. One of my tries looks as follows:
| @Name("aList")
| public class AList extends EntityQuery
| {
| private static final String[] RESTRICTIONS = {
| "b = #{aList.a.b}", };
|
| @Override
| public String getEjbql()
| {
| return "select a from A as a join a.b as b";
| }
| }
|
Which produces an error like:
| Caused by: java.lang.IllegalArgumentException: argument type mismatch
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
| ... 58 more
|
Another one like this:
| @Name("aList")
| public class AList extends EntityQuery
| {
| private static final String[] RESTRICTIONS = {
| "a.b = #{aList.a.b}", };
|
| @Override
| public String getEjbql()
| {
| return "select a from A as a";
| }
| }
|
Resolves in the same. In both cases, the query parameter is set properly to an object of class B.
What am I doing wrong? Or can just someone provide an example on how to restrict EntityQueries by @ManyToOne-related Entities?
Thanks for help,
Daniel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102557#4102557
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102557
18 years, 6 months
[JBoss Seam] - How to start jbpm business process from an async quartz meth
by pietermartin
Hi,
I have tried calling
| package com.yannitech.virgin.bpm.session;
|
| import java.util.Date;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.annotations.Transactional;
| import org.jboss.seam.annotations.async.Asynchronous;
| import org.jboss.seam.annotations.async.Expiration;
| import org.jboss.seam.annotations.async.FinalExpiration;
| import org.jboss.seam.annotations.async.IntervalDuration;
| import org.jboss.seam.annotations.bpm.CreateProcess;
| import org.jboss.seam.async.QuartzTriggerHandle;
| import org.jboss.seam.log.Log;
|
| @Name("pollPosForOBF")
| @Scope(ScopeType.CONVERSATION)
| public class PollPosForOBF {
|
| @Logger
| Log log;
|
| @Asynchronous
| @Transactional
| @CreateProcess(definition="OBFProcess")
| public QuartzTriggerHandle poll(@Expiration
| Date when, @IntervalDuration
| Long interval, @FinalExpiration
| Date endDate) {
| log.info("Async poll happening ja wol");
| return null;
| }
|
| }
|
The code executes but the a instance of the business process is not created.
What is the correct way to start a jbpm business process from an async process?
Thanks
Pieter
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102555#4102555
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102555
18 years, 6 months
[Installation, Configuration & DEPLOYMENT] - Re: JBoss debugging problem
by jaikiran
"tttito" wrote : OK, this seems to work.
|
| C:\e-workspace\jboss-4.2.1.GA\bin>run
| ===============================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: C:\e-workspace\jboss-4.2.1.GA
|
| JAVA: C:\Sun\SDK-5\jdk\jre\bin\java
|
| JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787,suspend=n -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djmx.invoke.getters=true
|
| CLASSPATH: C:\Sun\SDK-5\jdk\lib\tools.jar;C:\e-workspace\jboss-4.2.1.GA\bin\run.jar
|
| ===============================================================================
|
| Listening for transport dt_socket at address: 8787
| 12:11:40,509 INFO [Server] Starting JBoss (MX MicroKernel)...
|
| I just moved server=y before the address. Otherwise, since the server default option is "n", it apparently tries to open the socket at the wrong address. See the Xrunjwdp options at http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html.
|
| Cheers and thanks again.
|
| t
Strange. I wasn't aware that the positioning matters. I still find it hard to believe that this was the reason why it was failing. Are you sure that its not a coincidence that this started working after you changed the order of those parameters.
Furthermore, the link that you pointed to (http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html) mentions:
anonymous wrote : Sun's VM implementations require command line options to load the JDWP agent for debugging. From 5.0 onwards the -agentlib:jdwp option is used to load and specify options to the JDWP agent. For releases prior to 5.0, the -Xdebug and -Xrunjdwp options are used (the 5.0 implementation also supports the -Xdebug and -Xrunjdwp options but the newer -agentlib:jdwp option is preferable as the JDWP agent in 5.0 uses the JVMTI interface to the VM rather than the older JVMDI interface).
Have you tried using
| set JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102551#4102551
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102551
18 years, 6 months
[JBoss Seam] - Problem with
by tomas.petersson
Hello, I have a problem with "<f:facet name="aroundInvalidField">" rendering. The SPAN is not rendered around my field, but before it.
|
| Excerpts from my code:
| <f:facet name="aroundInvalidField">
| <span style="border-color: blue blue blue blue; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: solid;"/>
| </f:facet>
|
| <s:decorate>
| <h:inputText
| id="tiBillCodeId"
| value="#{_billCode.tiBillCodeId}">
| <s:validate/>
| </h:inputText>
| </s:decorate>
|
| Rendered HTML output:
| <div id="sioForm:billCodeTable:0:j_id24">
| <span style="border-color: blue blue blue blue; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: solid;"></span>
| <input id="sioForm:billCodeTable:0:j_id24:tiBillCodeId" type="text" name="sioForm:billCodeTable:0:j_id24:tiBillCodeId" value="bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla " class="inputText" tabindex="39" />
| <span class="errorMessage">måste vara mellan 1 och 30 tecken</span>
| </div>
|
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102545#4102545
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102545
18 years, 6 months