on 08-04-2008 2:25 PM
Hi all,
When using EJB Model on CE, to each method a Request and Response are generated. To a CRUD i've 4 methods.
I've a Foo (JPA Entity).
public Foo create(Foo)
public Foo update(Update)
public void remove(Foo)
public List<Foo> findBy...
I think that i could use a Single view for both create and update method. But i will need a separated context objects to each function.
Request_<Bean>_create
Request_<Bean>_update
What is better in this case? a single method createOrUpdate on my EJB? Or a View to each operation?
Best regards
Hi all,
Just to share my decision:
My EJB continue with the methods.
public Foo create(Foo)
public Foo update(Update)
public void remove(Integer)
public List<Foo> findBy...
Was generated one Request to each method.
Request_<Bean>_create
Request_<Bean>_update
I've mapped the both on my Component controller and have created on view to edit and create a new record.
When the record already exists i'm initializing the Request_<Bean>_createElement with record data, when is a new i've just initialize the new Foo object and put on currentElement of update.
On the generic save method of controller, a test is done to decide if the Request<Create> or Request<Update> model Object.
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.