I am using Hiberbnate 3.1.3. I have a mapping as below and when I try to insert a record into the TEST_TABLE, I get an Exception: \'Exception in thread \"main\" org.hibernat
You can specify schema for your generator using schema parameter:
<generator class="increment">
<param name="schema">TEST</param>
</generator>
Sadly, this is not well described in Hibernate documentation; you'd have to look at the API javadoc in order to find that out.
That said, Mark is right with regards to "increment" not being very efficient - it's also not safe in a cluster environment.
If the hibernate default schema is OTHER_SCHEMA then if you do not supply a schema for a table then it will automatically add the default
Solution is you have to add a schema for all table names except one the default. In this case you might be better off if you set the hibernate default to your schema.
Looking at the sequence using max(id) like that is not usually efficient, especially in Oracle which has sequences exactly for this use.