This content has been marked as final.
Show 4 replies
-
2. Re: Multiple <s:convertEntity /> from different persistence
jjarkko Oct 30, 2007 1:11 PM (in response to jjarkko)Sorry, I was only reading http://docs.jboss.org/seam/1.2.1.GA/reference/en/html/controls.html#controls.tags
-
3. Re: Multiple <s:convertEntity /> from different persistence
jjarkko Oct 30, 2007 1:29 PM (in response to jjarkko)And actually I solved the issue by using the unrestricted entity manager for getting the list and the use the restricted entity manger to load the entity.
public List <Manager> getManagers() { String query = "from Manager"; // use the unrestricted entity mananger to get the list Query q = adminEntityManager.createQuery(query); return = q.getResultList(); }
And later, when the admin is updating the entitypublic Manager modify(Manager selectedManager) { return unrestrictedEntityManager.find(Manager.class, selectedManager.getId()); }
EntityManager.find() does load the entity, even if manager.deleted is not null (and deleted is less than todate). So the filter is not applied when using EntityManager.find(), but I'll need to check that this is always true.
And this works because s:convertEntity also uses the same unrestrictedEntityManager. -
4. Re: Multiple <s:convertEntity /> from different persistence
jjarkko Oct 30, 2007 1:30 PM (in response to jjarkko)Ops, typo.
public Manager modify(Manager selectedManager) { return restrictedEntityManager.find(Manager.class, selectedManager.getId()); }