So I have a clickable dataTable that's based on a join of two tables. There is a
submit button for each row of the dataTable. I can't use the @DataModelSelection
annotation (commented below) b/c the List does not consist of only one Entity class,
it's based on two.
How can I identify which row needs to be updated and get all the necessary data for the
2nd table to be persisted to DB? 1st table is read-only. sounds like @DataModelSelection
is out of the question here (Java generics does not allow me to specify more than one type
per Collection).
any help much appreciated, otherwise I will resort to Seam remoting/ajax call onclick of
submit button per row...
code snippet from SFSB:
@DataModel
| private List myAuditList;
|
| @DataModelSelection
| //private TblSecurityAuditWorking tblSecurityAuditWorking;
|
| @Factory("myAuditList")
| public void find()
| {
|
| log.info("in find(): user.getUserId() = " + user.getUserId());
| log.info("in find(): user.getBillingId() = " + user.getBillingId());
|
| int employeeId;
|
| if (!networkId.equals("")) { //user entered a networkId from UI to
run for another person, so get new guy's billingId
|
| List myList = em.createQuery("from User u where u.networkId =
:networkId").setParameter("networkId", networkId).getResultList();
| User newUser = (User)myList.get(0);
|
| employeeId = newUser.getEmployeeId().intValue();
|
| myAuditList = em.createQuery("SELECT gem, tsaw "+
| "FROM TblSecurityAuditWorking tsaw, "+
| "GlobalEmployeeMaster gem "+
| "WHERE tsaw.id.siteId = gem.id.siteId "+
| "AND tsaw.id.employeeNumber = gem.id.employeeNumber "+
| "AND tsaw.reportToId = :employeeId")
| .setParameter("employeeId", employeeId)
| .getResultList();
| }
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099513#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...