This content has been marked as final.
Show 2 replies
-
1. Re: s:convertEntity equivalent without JPA Entities?
skidvd.seamframework.abilsoft.com May 18, 2009 4:09 PM (in response to skidvd.seamframework.abilsoft.com)Does anyone have any thoughts/ideas on this topic?
-
2. Re: s:convertEntity equivalent without JPA Entities?
luxspes May 18, 2009 5:47 PM (in response to skidvd.seamframework.abilsoft.com)Guess you could create a class like this:
@Name("anythingStore") @Install(precedence=BUILT_IN) @Scope(PAGE) public class AnythingStore { private List store; @Create public void create() { store = new ArrayList(); } public Object get(int index){ return store.get(index); } public int add(Object object){ if(!store.contains(object)){ store.add(object); } return store.indexOf(object); } }
and use EL expressions to get the assigned
index
for the objects stored in AnyEntityStore and use that as theid
for your objects in the UI, Since the object is of PAGE scope, the id will remain the same for an object as long as you stay in the same page (you can of course change to scope if you need it to last longer).