1 Reply Latest reply on Feb 22, 2007 8:36 PM by norman.richards

    Entity relations with metadata

    mikedougherty

      Hello all,

      I have a number of entities that relate to each other via a join table. So far the @Entity objects have mapped pretty well with @JoinTable/@JoinColumn. However, there is more data in the join table than just the id's of the entities it joins, such as EffectiveDate, EndDate, ModifiedDate, etc. There are also different join tables for each association (i.e. ENTITY_A_B_JOIN, ENTITY_B_C_JOIN, etc).

      The easiest solution would very likely be to create an Association superclass and subclass for each join I need to make. But I would like to challenge myself a little more and see if there is a Cool Seam way of solving the problem.

      Maybe using a combination of components.xml, injecting, and a generic class to come up with the solution. I haven't seen anything in the documentation that stands out as "the way" to do this. But maybe someone out there has done something similar and wouldn't mind pointing me to the appropriate features of Seam that will get me going in the right direction. Mind you, I'm not asking you to do my work for me, just point me to the sets of features, and creative uses thereof that will get me going.

      Thanks.