This may not entirely be an appropriate question to ask, but why not I'm curious and I do not know the right places to look for these answers (If y'all have links to said places please do drop them down!).
So say we have Entity A and B, of which A and B has a one-one/one-many relation(may be important, but to simplify they are simply just related)
And I want to retrieve entity B from an instance of entity A. So in other words, retrieveAfromB(). (Which params depends on if its one-one or one-many but for simplicity)
I immediately think of 3 ways that this method could be in:
- A simple getter method in A which returns B when called (Which should not be the case as getters should also be exposed in the session beans instead)
- In the entity session bean of A
- Or finally, in the entity session bean of B
At this point I am aware that I could have summarized my question down to whether 2. or 3. is more appropriate, and also what should be in an entity's session bean. Please enlighten me and thanks so much!