Hi Rohit, thanks for your reply.
We have a hibernate.default_schema configured. For example, we have it configured to point to SCHEMA_1. Most of our entities reside in SCHEMA_1. But we have a few entities that need to be mapped to a legacy database schema SCHEMA_2.
The entity itself is not a problem: there we can just use the @Table(name="TABLE_NAME", schema="SCHEMA_2") annotation. But the sequence, which we needed for entity identifier generation, also resides in SCHEMA_2. Apparently we can configure a sequence generator the following way: @SequenceGenerator(name = "sequenceGenerator", sequenceName = "SEQUENCE_NAME", schema = "SCHEMA_2")
Apparently, testing the mapping, the sequence cannot be found. It appears to be searching the sequence in the configured default_schema, and not in the schema attribute that is given to the @SequenceGenerator annotation. The schema attriibute herein is ignored.
|