From: Werner F. (JIRA) <web...@jp...> - 2007-05-08 19:49:47
|
[ http://www.jpox.org/servlet/jira/browse/CORE-3256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Werner Froidevaux updated CORE-3256: ------------------------------------ Attachment: AbstractTable.patch DuplicateColumnNameException patch for AbstractTable > SchemaTool: DuplicateColumnNameException with Oracle and CLOB > ------------------------------------------------------------- > > Key: CORE-3256 > URL: http://www.jpox.org/servlet/jira/browse/CORE-3256 > Project: Core > Issue Type: Bug > Components: Schema tool > Reporter: Werner Froidevaux > Attachments: AbstractTable.patch > > > SchemaTool reports a DuplicateColumnNameException in case where > 1) multipliple sub-classes S0, S1, ... are mapped to the same table T > 2) S0, S1, ... have members S0.s, S1.s of type string which are mapped to the same column T.columnS > 3) RDBMS is Oracle > The exception is raised by the method AbstractTable.addDatastoreField() in the following if() statement: > if (!mapping.getClass().getName().equals(col.getMapping().getClass().getName())) > { > // the mapping class must be the same (not really required, but to avoid user mistakes) > throw new DuplicateColumnNameException(this.toString(), (Column)columnsByName.get(name), col); > } > However, in the case described above mapping.getClass().getName() returns 'org.jpox.store.mapping.StringMapping' whereas col.getMapping().getClass().getName() returns 'org.jpox.store.rdbms.mapping.oracle.OracleStringMapping'. > The following test seems to be more correct: > if (!mapping.getClass().isAssignableFrom(col.getMapping().getClass())) > { > // the mapping class must be the same (not really required, but to avoid user mistakes) > throw new DuplicateColumnNameException(this.toString(), (Column)columnsByName.get(name), col); > } > Patch is attached. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://www.jpox.org/servlet/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |