Whenever I am calling the CMR method getParentcategory() on my QuestionCategories instance i am getting a Local object for the same entity bean from which i am calling method. e.g. If i have an entity bean instance for categoryId =2 whose parent is 1. When i am calling method "getParentcategory" on Local object of categoryId = 2 I am getting the same instance back i.e (getParent().getCategoryID = 2...again which should actually be 1).
"Java From Mandar", We're pleased to have you here with us in the EJB forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Both of your relationships in the jboss-jdbc.xml descriptor specify the same key-field: QuestionCategoryID. I don't know JBoss, but logically shouldn't one of them specify PARENTCATEGORY (DB column) and parentcategory (CMR field)?
The way you have it, the behavior you're seeing makes sense as two entities are related by their primary key. Clearly this results in each entity being related to itself.
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad: