I am trying to use one Hibernate mapping for several different databases: H2, Oracle, MySql.
Each database has a different list of reserved words.
I would like Hibernate to automatically escape the reserved words.
I know I can:
- use backticks to force escaping (escape everything just to be safe)
- change all identifiers so they are certainly not keywords in any database (make them ugly)
- tie the schema to a specific set of databases, escaping the union of keywords (will break if I add new database to the mix)
Is there a more elegant solution?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…