Hi mxc,

It's not specified whether getResultList returns a modifiable list or not, and openjpa returns an unmodifiable list. This choice makes it easier to implement features such as lazy query execution and scrolling results.

If you want to manage your own list, with just one line of code you can simply copy the list to your own list and do whatever you like with it. This is guaranteed portable behavior across JPA implementations.

Craig

On Dec 27, 2007, at 6:51 AM, mxc wrote:


Hi there,

I am sure this is a common scenario. I get a result list from a jpa query. I wrap this in an abstract table model. I allow the user to delete entities from the table by clicking a delete button on each row. In the back I delete the entity from the database. I do not wish to refresh the entire collection that is the core of the tale model but just want to remove the delete entity
and fire the appropriate table model change event.

However running list.remove(object) results in the error:

java.lang.UnsupportedOperationException: Result lists are read-only.

Is there anyway to mark the list as modifiable?

thanks

--
View this message in context: http://www.nabble.com/How-to-remove- an-entity-from-a-result-list-%28error---result-list-is-read-only%29- tp14513989p14513989.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to