• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to map an EJB in database apart from storing as BLOB  RSS feed

 
Ram Som
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My CMP EJB has the following CMP fields.
public class EmployeeBean implements EntityBean {
public int empID;
public String empName;
private javax.ejb.EntityContext entityContext = null;
final static long serialVersionUID = 206093459760846163L;
public Address address;
}

Where Address is as follows,
public class Address implements java.io.Serializable {
public java.lang.String houseNo;
public java.lang.String street;
}

Now, how to map Address in database apart from storing as BLOB.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Maybe this should be in a FAQ somewhere...)
We can't help you unless you tell us which Application Server you are working with. The database mapping tools and procedures are vendor-specific.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ram,
You can't map an object to the database with EJB's if it's not an EJB. What you want to try to do (for instance, have a Customer hold an Address) you must do in WebSphere and VAJ with CMP EJB Relationships. Basically, both your Customer and Address must both be EJB's. There is no other way to do this. I discuss this topic in a series of articles referenced on my web page below, and also at length in my book.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!