Hi,
here is part of my CRUD Interface.
Code:
T create(T newInstance);
T read (PK id);
void merge (T transientObject);
void remove(T persistentObject);
so i think possible solutions to my problem about remove are:
1. i change the remove method and give him too the param PK id
then i can call within remove find and there should be no problem to delete it.
2. i change merge method that i get a return value T so when i call find in my action i call merge after that and from what ive read so far my obj will change it state to perstistent and is ready to getting deleted.
are there any other suggestions maybe or which way is the better togo ?
edit: Solution 1. works pretty well, but 2. not i still get the exception about removing a detached object which kinda strange after a find the state should be detatched and after the merge it should be transient shouldn't it be? And i guess removing a transient obj should be a big deal ..strange.