Hi,

I've got existing POJO/DAO classes and I'm converting them into CMP Beans. 
Works fine. I've reached the case where I have a class Customer with an 
attribute Address (another class). 

public final class Customer extends PersistentObject {
    private String _id;
    private String _firstname;
    private String _lastname;
    private final Address _address = new Address();
}

public final class Address {
    private String _street1;
    private String _city;
    private String _zipcode;
}

To turn that into a CMP you would thing 'well, let's create 2 CMPs, one for 
Customer and one for address with a relation'. The problem is that I only have 
one DB Table t_customer with all attributes, but there's not table for address

CREATE TABLE T_CUSTOMER( id VARCHAR(10), PRIMARY KEY(id), firstname VARCHAR(50) 
NOT NULL, lastname VARCHAR(50) NOT NULL, street1 VARCHAR(50), city VARCHAR(25), 
zipcode VARCHAR(10));

And I don't want to create a second table (t_address). How can I use a CMP and 
map its composed attributes (address) into the table t_customer ? If I creat a 
BMP instead I will have problems with relationship between CMPs and BMPs.

Any help, thanks,

Antonio


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3863192#3863192

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3863192


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to