posted 18 years ago
You can't use sequences with MySQL, so I presume Hibernate will throw some sort of exception if you try. The sequence generation strategy will only work with those DBs that support sequences (DB2, PostgreSQL, Oracle, SAP, McKoi and Firebird). Its a little gotcha in Hibernate's "one mapping layer for all databases" claim, albeit an understandable and documented one.
However that mapping you posted is a native generation strategy, not a sequence generation stategy. Native will use another generator depending on the database. If its Oracle for example Hibernate will look for a sequence called UNIQUE_ID_SEQUENCE. If its MySQL, it will try to use something else (probably identity - but you'll find that out when you run it against your MySQL schema).