2 Replies Latest reply on Mar 28, 2008 7:53 PM by Pete Muir

    Re-use domain model.. Is Seam philosophy compatible with this goal?

    Guillaume Jeudy Master

      Hi,


      We have a persistent model which also happens to be our domain model. We don't have a requirement to decouple the domain model from the UI. Therefore we use JPA annotations and can leverage UI integration goodies thanks to Seam with:


      <s:entityConverter /> and integrate hibernate validation <s:validateAll />



      The problem that we encounter now is that as far as I understand one cannot use


      <s:entityConverter /> and <s:validateAll />



      if you define your JPA mapping through XML descriptors instead of annotations. Can anybody confirm this ?


      For this reason we are now stuck and cannot reuse our domain model in other applications which might not be using seam and which more importantly might use a different JPA mapping.


      The obvious workaround would be to define separate JPA XML descriptors for the other applications and override the JPA annotations embedded on the class. But then you always run into the potential confusion of which mapping is actually overriding what. I am just curious if anybody using Seam defined its mapping through JPA XML only and what his or her development experience was with this approach.


      Did anyone run across similar design issues ?


      For now we will be forced to define a separate domain model with no annotations for use in the other application because of seam's strong dependency on JPA annotations.


      Thanks,