Thanks for the reply. Collection is already annotated with Cascade.REMOVE -
merge() doesn't work in this instance. I think I need a way to get to the
EntityManager inside my Entity Bean. For example:
| @Entity
| public class Container {
| private List<Item> items;
|
| @OneToMany(mappedBy="security", cascade=CascadeType.ALL)
| @MapKey (name="key")
| public Map<String, SecProperty>getProperties();
|
| ...
|
| public void removeProperty(String key) {
| if (getProperties().containsKey(key)) {
| Object obj = getMyProperties().remove(key);
| //
| // This is where I think I could use the EntityManager
| // to delete from database:
| //
| em.remove(obj);
| }
| }
| }
|
What is the best way to inject the EntityManager into an Entity Bean? Or is
there is another way to accomplish this without using the EntityManager?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3912350#3912350
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3912350
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user