Discussions

EJB design: Need Help in EntityBeans

  1. Need Help in EntityBeans (2 messages)

    Hello Everyone

    My friend asked me a doubt in EntityBeans. What shall we do if there are two primary key classes for a Bean, how can we map them in the deployment descriptor? Something like ... Address and Id are two primary keys for a person. I couldnt answer him. I want to know, can we do it first of all, if so, how can we do? Plz help me !!!

  2. Re: Need Help in EntityBeans[ Go to top ]

    Hello Everyone

    My friend asked me a doubt in EntityBeans. What shall we do if there are two primary key classes for a Bean, how can we map them in the deployment descriptor? Something like ... Address and Id are two primary keys for a person. I couldnt answer him. I want to know, can we do it first of all, if so, how can we do? Plz help me !!!

    You can never have 2 primary keys. Primary means first or one..... You can have a primary key that is made up of multiple fields - called a composite primary key. More info here: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/BMP5.html
  3. Re: Need Help in EntityBeans[ Go to top ]

    Both must derive from a single Base class.