openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ubiteck <>
Subject Re: How to unenhance entities ?
Date Wed, 17 Mar 2010 18:19:25 GMT

According to the test case your send to me i wrote the following method
without success :

	public Company getTestCompany(long id) {

		OpenJPAEntityManager jpaEm = OpenJPAPersistence.cast(em);
		Company found =  jpaEm.find(Company.class, id);
		if (!jpaEm.contains(found)) throw new IllegalStateException("entity not in
		if (jpaEm.isDetached(found)) throw new IllegalStateException("entity
should not be detached yet");"Detaching...");
		Company detached = jpaEm.detach(found);"Detaching...done ");
		if (!jpaEm.isDetached(found)) throw new IllegalStateException("entity
should be detached");
		return detached;

It throws an exception "entity shoul be detached". The return value
(detached) is not considered as detached !  

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message