Icey Thomas [
http://community.jboss.org/people/icey.xiong] created the discussion
"static class act as an entity ,EntityNotFoundException happend when delete the last
record"
To view the discussion, visit:
http://community.jboss.org/message/633986#633986
--------------------------------------------------------------
Dear all,
I write an entity like this:
@Entity
public class Employee
{
@Id
private long id;
private String name;
@OneToMany
private Mao<String,EmpDetail> detail=new TreeMap<String,EmpDetail>();
//set ,get functions pass
@Entity
public static class EmpDetail
{
@Id
protected long id;
protected String address;
//set ,get functions pass
}
}
I delete an EmpDetail like this:
em.remove(em.getReference(EmpDetail.class,4)); // em is the entity manager
I delete the record successful but the last one.
Exception is here: javax.persistence.EntityNotFoundException:deleted entity passed to
persiste:(...Employee$EmpDetail#<null>)
some one knows what is going on? thank you!
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/633986#633986]
Start a new discussion in EJB Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]