[jboss-user] [JBoss Seam] - help with EntityList

terryb do-not-reply at jboss.com
Tue Oct 30 23:17:45 EDT 2007


With application based on seam-gen, the MyEntityList feature is based on single table. I guess it is possible to make it work with multiple tables. wondering anyone can help me out?

Table Associations
Client--->Contacts--->Addresses
Clients--->Applications

---> represents one-to-many

I get errors like, even though all my search columns are text:
11:39:16,776 ERROR [DebugPageHandler] redirecting to debug page
java.lang.NumberFormatException: For input string: "username" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:447)

Say would like to search by:
client.username, contact.surname, address.postcode, application.status


  | @Name("clientList")
  | public class ClientList extends EntityQuery {
  | 
  |   private static final String[] RESTRICTIONS = {
  |       "lower(client.username) like concat('%',lower(#{clientList.client.username}),'%')",
  |       "lower(contact.surname) like concat('%',lower(#{clientList.contact.surname}),'%')",
  |       "lower(address.postcode) like concat('%',lower(#{clientList.address.postcode}),'%')",
  |       "lower(application.status) like concat('%',lower(#{clientList.application.status}),'%')",
  |     };
  | 
  |   private Client client = new Client();
  |   private Contact contact = new Contact();
  |   private Address address = new Address();
  |   pircate Application application = new Application();
  |   
  |   @Override
  |   public String getEjbql() {
  |    
  |     return "select client.username, contact.surname, address.postcode, application.status " +
  |         "from Client client inner join client.contacts contact....????????????????"; 
  |   }
  | 
  |   public Client getClient() {
  |     return client;
  |   }
  |   
  |   public Contact getContact() {
  |     return contact;
  |   }  
  | 
  |   public Address getAddress() {
  |     return address;
  |   }
  | 
  |   public Application getApplication() {
  |     return application;
  |   }
  | 
  | ...
  | 
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100486#4100486

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100486



More information about the jboss-user mailing list