Hello,
we have a problem with enhanced entities. It is very important to solve this issue.
There are three entities in two OSGi-Bundles and we execute importRequirements() in RequirementServiceImpl:
__________________________________________________________ Bundle A: @Entity class ModelElementImpl { @Basic private String name; public void setName() { this.name = name; } public String getName() { return name; } } @Entity class MessageImpl { @OneToOne private ModelElementImpl e; @Basic private String desc; public void setDescription(String desc) { this.desc = desc; } } class MessageServiceImpl { public void addMessage(ModelElementImpl e) { MessageImpl m = new MessageImpl(); m.setDescription(e.getName()); // throws the exception } } __________________________________________________________ Bundle B: @Entity class RequirementImpl extends ModelElementImpl { } class RequirementServiceImpl { public void importRequirements() { RequirementImpl requirement = new RequirementImpl(); requirement.setName("req1"); messageService.addMessage(requirement); entityManager.persist(requirement); ... } } __________________________________________________________
But when we used not enhanced entities, we have no problems.
The following exception is thrown when we execute the example:
Caused by: com.objectdb.o._EntityNotFoundException: Entity is not found: com.btc.ep.requirement.bl.internal.model.RequirementImpl#'A0C92E7F-BDDA-4902-A8CB-95C5034ADCA2' at com.objectdb.o.JPE.g(JPE.java:94) at com.objectdb.o.ERR.f(ERR.java:56) at com.objectdb.o.OBC.onObjectDBError(OBC.java:1503) at com.objectdb.o.ENT.ak(ENT.java:1640) at com.objectdb.o.ENT.beforeAccess(ENT.java:1128) at com.btc.ep.base.bl.impl.NamedElementImpl.__odbGet_name(NamedElementImpl.java:1) at com.btc.ep.base.bl.impl.NamedElementImpl.getName(NamedElementImpl.java:40) at com.btc.ep.base.bl.impl.NamedElementImpl.toString(NamedElementImpl.java:50) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuffer.append(Unknown Source) at com.btc.ep.base.bl.internal.MessageServiceImpl.genString(MessageServiceImpl.java:157) at com.btc.ep.base.bl.internal.MessageServiceImpl.addMessage(MessageServiceImpl.java:198) at com.btc.ep.base.bl.internal.MessageServiceImpl.addMessage(MessageServiceImpl.java:220) at com.btc.ep.base.bl.MessageService.info(MessageService.java:163) at com.btc.ep.requirement.bl.internal.RequirementImportServiceImpl.addReq(RequirementImportServiceImpl.java:146)