[jboss-user] [EJB 3.0] - Re: Need some help with mapping

MikeDougherty do-not-reply at jboss.com
Mon Apr 2 11:59:24 EDT 2007

Thanks for your response Felix. But I'm not sure you are understanding the problem. I am not mapping Items in a store. I am mapping attributes *of* a store. If you look in the example code I posted, there is a Type of store. What is not in the post are other attributes like, Status, Region, etc. The possible values of these "types" is stored in the TYPE_TABLE.

Think of them as enumerated types, but rather than being hard coded in a class file, the types are kept in a database.

Also, note that I am mapping to a legacy system, so I have no control over the data model.

So to answer your questions:

* Yes, the TABLE_NAME is the name of the table that my Store object is mapped to. The only thing I am using it for at present is in the TypePK object to ensure uniqueness.

* Store does not extend Item. What I had was a StoreType extending Type. Not because I thought I needed a StoreType, but because it seemed the only way to map the Type object to the appropriate sub elements in the Type table.

* Also, I'm not sure @EmbeddedId and @Embeddable will work in this case. But feel free to correct me if I am wrong. The STORE table only has storage for one field in the PK (ITEM_ID). So it can not store the entire PK object.


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

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

More information about the jboss-user mailing list