Details
-
Improvement
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
5.0.6
-
None
-
None
Description
I was working on implementing something similar to TAPESTRY-1653 and ran into a problem. In our system, all hibernate entities implement an interface. I wanted to create a coercion that would handle going from String -> entity and from entity -> String. The problem with this was that, with the way coercion currently works, you have to add coercions for every concrete enttiy type rather than having one coercion that knows how to load any entity from the Session by id. This introduces a chicken-and-egg problem where in the coercion depends on the Hibernation Configuration being created already. This causes IoC to kick out because there is a dependency loop. Either I need to find a way around the dependency loop (which I can't see how) and register coercions for each specific entity type at start-up or register one coercion for all entities.
Obviously this introduces some complications with the coercion logic but it appears to be very much a necessary ability. I'm not opposed to implementing it others can chime in if they have opinions about this.