> > Finally, we are on the same page ..not even a blue moon ... About time :) > Yup this is a suggestion. I agree 100% we need to avoid using > jbosscmp-jdbc.xml. > > > Ultimately at the database level for each table there has to > be a unique > column name(s) that acts as a foreign key for the relation. It also > can only participate in 1 relation.
What? Did you really mean that a table can only participate in 1 relationship? > For a many to many relationship with a mapping table could be > a problem > if the field name on both sides of the relationship were the > same. But I > would see this as an exception not the rule. > > For self joins you would have to do like you do in the EJBQL > and prefix > the column with the table name. Not a bad idea for all relations so > > select uuid from CDTrack where composer=? > > would be > > select c.uuid from CDTrack as c where c.composer=? agreed. The column names are constructed to make the code easier to write. There are a lot of cases you are forgetting. Here is a short list: Many side does not have an accessor, so no name to use. One side has a complex pk. One side uses a DVC for a pk. One side has a complex pk which uses a DVC. So what rules do you propose for the fk case. For relation tables, you have the additional problem of name collision between the entities. It is very common to have all entities to use a pk named id or oid. This is not a high priority for me, so what system do you propose? -dain _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development