Promoting an oracle table to entity using Row_ID

User 7b0ee04e66

11-11-2011 14:55:16

Hi.


We are trying to promote an oracle table to an IJC entity and when choosing Row_ID as the ID column we cannot insert a record and get the error message below:


We are running IJC 5.5.1 and Oracle 10g.


Any ideas here?


Thanks,


Catherine & Mike.



org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO ZEBRAFISH.AQUARIUM(


AQUARIUM_ID,ROWID,AQUARIUM_NAME,AQUARIUM_CODE


) values (


?,?,?,?


)]; nested exception is java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification


 


at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)


at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)


at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)


at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)


at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)


at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811)


at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:833)


at com.im.df.impl.db.dao.DFDaoSupport.insertUsingSequence(DFDaoSupport.java:141)


at com.im.df.impl.db.dao.PKFromSequenceJdbcDao$SequenceDMLImpl.insert(PKFromSequenceJdbcDao.java:39)


at com.im.df.impl.db.dao.DFDaoSupport.insert(DFDaoSupport.java:126)


at com.im.df.impl.db.dao.DFDaoWrapper.insert(DFDaoWrapper.java:64)


at com.im.df.impl.db.DBEntityDataProviderImpl.doInsertRow(DBEntityDataProviderImpl.java:415)


at com.im.df.impl.db.DBEntityDataProviderImpl.access$5(DBEntityDataProviderImpl.java:355)


at com.im.df.impl.db.DBEntityDataProviderImpl$3.doInTransaction(DBEntityDataProviderImpl.java:346)


at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)


at com.im.df.impl.db.DBEntityDataProviderImpl.insertOrFindRow(DBEntityDataProviderImpl.java:341)


at com.im.df.impl.db.InsertionHandler.doInsertData(InsertionHandler.java:301)


at com.im.df.impl.db.InsertionHandler.doInTransaction(InsertionHandler.java:261)


at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)


at com.im.df.impl.db.DBSchemaDataProviderImpl.insert(DBSchemaDataProviderImpl.java:208)


at com.im.ijc.core.api.actions.InsertRowAction$3.phase1InRequestProcessor(InsertRowAction.java:410)


at com.im.commons.progress.BackgroundRunner.processTheTask(BackgroundRunner.java:128)


at com.im.commons.progress.BackgroundRunner$1.run(BackgroundRunner.java:91)


at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)


at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)


Caused by: java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification


 


at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)


at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)


at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)


at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)


at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)


at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)


at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)


at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1010)


at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)


at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)


at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3657)


at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1062)


at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)


at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)


at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)


at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:817)


at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)


at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)


... 20 more



ChemAxon fa971619eb

14-11-2011 08:24:12

Hi, Catherine, Mike,


It seems that you added the ROWID column, but not as the ID field? Your example seems to suggest that the AQUARIUM_ID column is the ID field and ROWID is present as an additional field?


When this happens the ROWID column is incorrectly treated as editable. We need to fix this, but I think in your case you need either the AQUARIUM_ID column or the ROWID column but not both.


Tim


 

User 7b0ee04e66

15-11-2011 08:29:38

Hi Tim


We were trying to promote the foreign keys automatically from Instant JChem and played with various options.


Our problem is that we want to implement a foreign key against a column with a unique constraint, as this data is meaninful to the other when they need to add data to the other table.


It looks like IJC cannot detect the foreign keys in such cases, and that we need to promote the relationships ourselves.


We have found a work around now.


Thanks


Catherine & Mike