This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple Primary Keys

 
tan kian
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i do this in j2ee? for example,i want sid,pid and cid to be the primary keys. do i specify something like this in the localHome?

public EnrolLocal create(String sid,String currentsem,String pid,String cid) throws CreateException,RemoteException;
public EnrolLocal findByPrimaryKey(String sid) throws FinderException;
public EnrolLocal findByPrimaryKey(String pid) throws FinderException;
public EnrolLocal findByPrimaryKey(String cid) throws FinderException;

or like this:

public EnrolLocal findSid(String sid) throws FinderException;
public EnrolLocal findPid(String pid) throws FinderException;
public EnrolLocal findCid(String cid) throws FinderException;
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope, your complex key will be an object
 
tan kian
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so should it be like this?
public EnrolLocal create(String sid,String currentsem,String pid,String cid,MixedKey multipleKey) throws CreateException,RemoteException;
public EnrolLocal findByPrimaryKey(MixedKey multipleKey) throws FinderException;

and multipleKey will be something like this:
public MixedKey(String sid,String pid,String cid)
[ September 10, 2005: Message edited by: tan kian ]
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to be sure, you may have to check the book,

in addition, you will need to learn how to create the complex key object, there are methods that must be in the class, e.g. i think one method is on hash
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic