Never mind - I installed Oracle myself and did some testing.  Here's what I found...
 
getColumns() won't return data from synonyms unless the "includeSynonyms" property is set to true on the DB connection.  Even then, getColumns() will return the schema of the target table.  For example, I created a public synonym "FRED" for " HR.EMPLOYEES".  getColumns() returns the columns as if they are in table "HR.FRED".
 
This means that you can use abator AS IS to generate objects from synonyms.  Set the property "includeSynonyms" to "true" on the abator connection configuration, specify the synonym as the table name, and don't include any schema information.
 
But...no amount of coaxing will persuade Oracle to return primaryKey or index information from a table synonym, so the generated objects will likely be incomplete (BTW - the "select *" method doesn't help here either).
 
Bottom line - generating objects from Oracle synonyms is problematical at best.
 
One thing that would help (and would be a good addition to abator) is the ability to ignore the schema qualifier in generated objects and change the table name.  I'm thinking this:
 
<table tableName="EMPLOYEES" schema="HR">
  <property name="ignoreQualifiers" value="true"/>
  <property name="tableSynonym" value="FRED"/>
</table>
 
This would generate objects based on HR.EMPLOYEES, but the SQL would write queries to FRED.
 
Thoughts???
 
Jeff Butler


 
On 9/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
I'll have to experiment some more with the JDBC metadata APIs to find out how they respond. I'll see if I can get to that this afternoon.

 

Reply via email to