[jboss-dev-forums] [EJB Development] - static class act as an entity , EntityNotFoundException happend when delete the last record
Icey Thomas
do-not-reply at jboss.com
Fri Oct 28 01:00:47 EDT 2011
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&containerType=14&container=2093]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20111028/d84fa6b1/attachment.html
More information about the jboss-dev-forums
mailing list