|[eclipselink-users] Re: dynamic entity example code: one Entity Manager for both static and dynamic entities?|
Hi,so i have continued experimenting and have found that i inheritance is not yet supported?
but should be able to fix my inheritence issue by creating a standard static entity and having normal relations and inheritence and the create a dynamic entity using this technique but using the same key as the static entity.. (which results in a joined table layout)
** one other question that i have is with the entity manager.. is it possible to use the one entityManager for both dynamic and static entities?
i have tried using the dynamic emf to get the em and this works great for the dynamic entities however when i try to use this to persist a standard static entity then
persistStandardEntityTest FAILED!!java.lang.IllegalArgumentException: Object: entity.Unit@c3b70f is not a known entity type. at org .eclipse .persistence .internal .sessions .UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3817)
just wondering once again if i have over looked something? it has no knowledge of the standard static entities and the annotations?
would anyone have some advice on how to merge the two or make the dynamic entity manager find info on the static entities?
thanks, -lachlan On 18/07/2008, at 1:09 PM, Lachlan Gregor wrote:
Hi,just to build on my question I have continued experimented with these and have another question that would love some advice: inheritance? can a dynamic entity inherit attributes and relationships from superclass in a standard JOINED fashion?any advice would be great, thank you, -lachlan On 15/07/2008, at 10:02 PM, Lachlan Gregor wrote:Hi,I was just wondering if anyone could shed some light on making use of the feature of dynamic entities however with relationships that map to standard static entities? From my understanding and some trial and error i have noticed that when using the dynamic entities a custom entityManager is required(as the dynamicEnitities do not use persistence.xml?), than when using standard entities and the two are not complementary?Is there any thing that i may have overlooked?I would like to have bi-directional relationships with the DynamicEntity superclass(which would spawn sub-classes) to other standard entities? however the DynamicEntity class is not an jee entity , thus requiring a special em, which makes creating relationships somewhat challenging?any insight would be great, it feels like i might be missing something?thanks, -lachlan
Back to the top