Hi,

I saw something on a forum about the same issue, in a nutshell they say that
it *will* work if Object is used as the primary key type. Is this
information incorrect?

To use undefined primary keys, the bean class and it's interfaces use the
Object type to identify the primary key. The ejbCreate method could be:

public abstract class MyEntityBean extends javax.ejb.EntityBean {
public Object ejbCreate (String oneFK, String twoFK, String threeFK) {
....
   return null;
}
}

The findByPrimaryKey() method defined int he local and remote home
interfaces must also use an Object type:
public interface MyEntityBeanHome extends javax.ejb.EJBHome {
public MyEntityBeanLocal findByPrimaryKey (Object primaryKey) throws
javax.ejb.FinderException;
}

Thanks,
Paul

> -----Original Message-----
> From: Konstantin Priblouda [mailto:[EMAIL PROTECTED]]
> Sent: 20 December 2002 11:03
> To: Reeves, Paul
> Cc: xdoclet-user
> Subject: Re: [Xdoclet-user] Database Compound Primary Key Issue
>
>
>
> --- "Reeves, Paul" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > We have a number of database tables where the
> > primary key is a compound
> > primary key.
> >
> > This in itself is not a problem (as we always use a
> > EntityNamePK class for
> > the primary key).
> >
> > What is a problem is that none of these columns are
> > @ejb.persistence columns
> > - they are all themselves foreign keys ie
> > @ejb.relations
> >
> > How can we tag this in XDoclet? because XDoclet
> > complains if we use
> > @ejb.pk-field without using @ejb.persistence
> >
> > (and we can't use @ejb.persistence with the
> > @ejb.relation tag!!!!)
>
> At least JBoss has problems with CMR fields ( your FK
> )
> being also CMP fields. Not sure for other app servers.
>
> Maybe you shall look at some O/R mapping tool
> as your persistenze layer - like Hibernate, and
> throw aaway your entity beans.
>
> I'm playing with it right now and it looks awesome
> ( and I'm developing xdoclet support for it )
>
> gr�� aus Wiesbaden,
>
> =====
> Konstantin Priblouda ( ko5tik )    Freelance Software developer
> < http://www.pribluda.de > < play java games -> http://www.yook.de >
> < render charts online -> http://www.pribluda.de/povray/ >
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>


Any e-mail message from the European Central Bank (ECB) is sent in good faith but 
shall neither be binding nor construed as constituting a commitment by the ECB except 
where provided for in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any 
unauthorised disclosure, use or dissemination, either in whole or in part, is 
prohibited.
If you have received this e-mail in error, please notify the sender immediately via 
e-mail and delete this e-mail from your system.



-------------------------------------------------------
This SF.NET email is sponsored by:  The Best Geek Holiday Gifts!
Time is running out!  Thinkgeek.com has the coolest gifts for
your favorite geek.   Let your fingers do the typing.   Visit Now.
T H I N K G E E K . C O M        http://www.thinkgeek.com/sf/
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to