Ignoring PK class in findByPrimaryKey through xdoclet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vagabond_heart
Posted On:   Monday, April 1, 2002 12:46 AM


Hi,

I am having following problem. I have a CMP bean whose primary key is Long type. I have not created any PK class as it is not required.
Also I don't want to generate PK class for this bean so I didn't use tag within my build.xml but when it generates a localhome/home interface it has a method findByPrimaryKey(CustomerPk custPK) which takes a PK class arguement which does not exist at all. This gives compilation error. How can I make changes through XDoclet tags so that it takes a Long type as an arguement ie findByPrimaryKey(Long id). Please let me know ASAP.

Re: Ignoring PK class in findByPrimaryKey through xdoclet

Posted By:   Ara_Abrahamian  
Posted On:   Tuesday, April 2, 2002 10:15 AM

Ask yourself this question: how does xdoclet find out which primary key class to use? Afterall xdoclet should put a class name in ejb-jar.xml for pk class, right? Well, if you don't specifically specify it then it looks at the and defaults to generating it for you. What you should do now is to specify pk type for the ejb with @ejb:pk class="java.lang.Long" class level tag. Take a look at @ejb:pk's documentation for more details.


Ara.

About | Sitemap | Contact