File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and Other Java EE Technologies and the fly likes How to map an EJB  in database apart from storing as BLOB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "How to map an EJB  in database apart from storing as BLOB" Watch "How to map an EJB  in database apart from storing as BLOB" New topic
Author

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

Ram Som
Greenhorn

Joined: Nov 23, 2001
Posts: 1
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

Joined: Aug 10, 2001
Posts: 3878
(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 of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
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.
 
IntelliJ Java IDE
 
subject: How to map an EJB in database apart from storing as BLOB
 
Threads others viewed
CMP- Entity Bean
Entity EJB and BLOB
WebSphere V5 CMP create problem
error when running ejbc on my jar file
Mapping String To CLOB datatype using WSAD 4.0
MyEclipse, The Clear Choice