(Prev mail thread:- http://www.mail-archive.com/[EMAIL PROTECTED]/msg20770.html) More on this... Looks like, single table registry approach was taken to dump all rows fetcted from database without linking DataObjects, as there is no relationship information in DAS Config. So, from the above mail thread, as join between singer and song returns 3 rows, there were 3 singer DOs and 3 song DOs and it is user's responsibility to see that out of 3 singer DOs 2 are actually identical.
So question here is...can DAS use DatabaseMetadata.getCrossReference() JDBC API to form relationship information when it is missing in DAS Config. To keep matter simple, DAS can take approach of using DAS Config relationship info as first priority and DatabaseMetadata.getCrossReference() as next priority. In case queries involve tables where for some relationship is defined in DAS Config and for some it is not, DAS can just stick to DAS Config. i.e. avoid mixing DAS Config provided relationship info and DBMS provided relationship info. Whatever is the approach (we can take mixed approach too, for that matter), it just needs to be documented clearly. DAS - from the basic usage so far, promotes less config and thus uses DBMS Metadata info for tables and columns when one is not available in DAS Config. So same can be extended for Relationships too. Are there any known issues around usage of DatabaseMetadata.getCrossReference()? Checked for Derby, MySQL so far and found no issues. Also, if some vendor do not have implementation for this method, we can detect exception/null/empty ResultSet returns and continue the way we are at present using SingleTableRegistry. Comments? Regards, Amita