I did only override getTableIdentifierStrategyName to return "native":
Code:
public OracleReverseEngineeringStrategy(ReverseEngineeringStrategy strategy) {
super(strategy);
}
@Override
public String getTableIdentifierStrategyName(TableIdentifier arg0) {
return "native";
}
While trying to persist an object with Hibernate, I get an exception saying that the sequence does not exist!Code:
2007-06-03 18:52:08,495 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 2289, SQLState: 42000
2007-06-03 18:52:08,495 [main] ERROR org.hibernate.util.JDBCExceptionReporter - ORA-02289: Sequence ist nicht vorhanden.
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not get next sequence value
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:96)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:468)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:463)
at org.myorg.myapp.persistence.hibernate.dao.MyEntityDaoImpl.makePersistent(MyEntityDaoImpl.java:43)
at org.myorg.myapp.persistence.hibernate.dao.MyEntityDaoImpl.makePersistent(MyEntityDaoImpl.java:1)
at org.myorg.myapp.persistence.hibernate.manager.MyEntityManagerImpl.makePersistent(MyEntityManagerImpl.java:41)
at org.myorg.myapp.persistence.test.Test.main(Test.java:19)
Caused by: java.sql.SQLException: ORA-02289: Sequence ist nicht vorhanden.
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:75)
... 11 more
.....
.....
2007-06-03 19:03:26,770 [main] DEBUG org.hibernate.util.JDBCExceptionReporter - could not get next sequence value [select hibernate_sequence.nextval from dual]
Looking into the Oracle database there definitely is a sequence realting to the object I am about to persist.