[JBoss Seam] - Query that selects all rows.
by jimjamz
Can somebody help me create a query that selects all rows within a table. I'm trying to build an SelectItems boject that contains all the states within the US. I get a ClassCastException each time I try to render the page that has my selectitem component. I looked at the jboss-seam-booking.ear and it is similar to what the BookListAction.java class, but I don't have an @In value and when I do create an @In value of state it gives me another exception.
I created a local EJB called StateList.java
| @javax.ejb.Local
| public interface StateList{
| public List<State> list();
| }
|
Then I try to implement it in StateListAction.java
| public class StateListAction implements StateList{
| @PersistenceContext
| EntityManager em;
| .................
| public List<State> list(){
| List<State> list = em.createQuery("select id, name from State");
| ...
| or
| List<State> list = em.createQuery("from State");
| return list;
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977719#3977719
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977719
19 years, 7 months
[JBossWS] - Re: JSR 181 @HandlerChain annotation w/ custom loader reposi
by thomas.diesler@jboss.com
According to JSR181 the handler file can also be specified relative to the endpoint class. The logic we use is
| URL fileURL = null;
| String filename = anHandlerChain.file();
|
| // Try the filename as URL
| try
| {
| fileURL = new URL(filename);
| }
| catch (MalformedURLException ex)
| {
| // ignore
| }
|
| // Try the filename as File
| if (fileURL == null)
| {
| try
| {
| File file = new File(filename);
| if (file.exists())
| fileURL = file.toURL();
| }
| catch (MalformedURLException e)
| {
| // ignore
| }
| }
|
| // Try the filename as Resource
| if (fileURL == null)
| {
| fileURL = epMetaData.getResourceLoader().getResource(filename);
| }
|
| // Try the filename relative to class
| if (fileURL == null)
| {
| String packagePath = wsClass.getPackage().getName().replace('.', '/');
| fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" + filename);
| }
|
| if (fileURL == null)
| throw new WSException("Cannot resolve URL to handler file: " + filename);
|
relative to class is available from jbossws-1.0.4
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977717#3977717
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977717
19 years, 7 months