-
1. Re: Why are Entity beans not annotated with @Name from seam-gen
jeanluc Oct 14, 2009 5:14 PM (in response to daxxy)Why do you find this ironic? Why would you want entities to be Seam components by default?
-
2. Re: Why are Entity beans not annotated with @Name from seam-gen
asookazian Oct 14, 2009 5:33 PM (in response to daxxy)In most cases, it is unnecessary for the entity class to be a Seam component. Here is an example in the ref doc where it is necessary:
http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html_single/#d0e483
If the entity class (component) is directly referenced in the JSF EL, then you will need @Name at the class level.
If seam-gen added @Name to all the entity classes generated, there would be unnecessary extra overhead involved in most cases in terms of the Seam container managing that component and providing interceptor services (bijection, etc.) Although I'm not sure it's allowed to inject/outject in an entity class, but you get the idea....
-
3. Re: Why are Entity beans not annotated with @Name from seam-gen
daxxy Oct 14, 2009 7:32 PM (in response to daxxy)I had a situation where I was stumped by the fact that my entity was not a seam component -- I can't remember the details -- and I was very surprised at this. It's seam after all! Shouldn't everything that could be a Seam component be a seam component??
:-)
I'm very new to j2ee programming and even java programming and sometimes you more seasoned programmers can't quite get your heads around the perspective of a beginner. Consider this one of those questions.
tdr
-
4. Re: Why are Entity beans not annotated with @Name from seam-gen
daxxy Oct 14, 2009 7:33 PM (in response to daxxy)Yes, that's a helpful answer. Thanks. I think in my first seam project I turned every entity into a seam component. I think I thought the fact that my entities were not seam components was a bug?! I'll have to review my code as I certainly want to eliminate all unnecessary overhead.
Thanks!
tdr