I'm using hbm2ddl with annotationconfiguration to generate a database creation script.
A neat feature is that you can use the Hibernate @Table annotation to specify a comment/description for the table in the datatbase. However, if I annotation my Comment entity class with
Code:
@org.hibernate.annotations.Table(appliesTo = "component_comment", comment = "A user's comment on a component")
then hbm2ddl generates an SQL script that includes:
Code:
comment on table component_comment is 'A user's comment on a component';
which breaks because of the single quote in
user's. This should be escaped like
user''s with two single quotes.