hi, everyone: Currently i am working on an project which will use lots of entity beans. If the one table (called A) has a foreign key to another table (called B) and my two entity beans(let's call entity A and entity B) are built on the two table separately, what should i do if i want to delete one record in B? i need to delete the corresponding record in A first? Another word, must invoke the remove method in entity A first? Regards Xiaoma Wang
Originally posted by xiaoma wang: hi, everyone: Currently i am working on an project which will use lots of entity beans.
Hi! As for me, there is better way that can be used istead of using CMR relationships in your project (expecially when your projecty is very large with many tables and many foreign keys). When you you use CMR with your project you should use name agreement for your CMR-fields, you have to care about uni- or bidirectional character of your relationships. And, as I got during my project (more than 60 tables) applivcation server does re-mapping your CMR-fields and, as a result, your project's operating speed are very low. Of course, Chris Mathews is right -- using CMR fields are the easiest choice for developing (in spite of some reservation like inserting new records in PostCreate and so on and much bigger deployment descriptors) but you should pay some application spped for this simplicity. IMHO better way to manage your FK logic via models for each tables, and use entity-beans for deleting/inserting/updating needs only. But, of course, it's up to you. Regards.