-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: hbm2ddl: single quotes not escaped in table comment
PostPosted: Tue Jan 15, 2008 6:41 am 
Newbie

Joined: Tue Jan 15, 2008 6:16 am
Posts: 4
Location: Rotterdam, NL
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.

_________________
Hibernate 3.2.5.GA, Hibernate EntityManager-3.3.1.GA, Hibernate Search 3.0.0.beta3, Hibernate Tools 3.2.0.CR1, PostgreSQL 8.2.5


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 15, 2008 10:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
sounds like a bug in the ddl generation - submit a patch/request to jira.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Where in JIRA?
PostPosted: Tue Jan 15, 2008 10:56 am 
Newbie

Joined: Tue Jan 15, 2008 6:16 am
Posts: 4
Location: Rotterdam, NL
Which JIRA project and component do you think I should create a bug for? There seem to be 'wrong DDL' bugs scattered across different components in HHH, ANN and HBX.

_________________
Hibernate 3.2.5.GA, Hibernate EntityManager-3.3.1.GA, Hibernate Search 3.0.0.beta3, Hibernate Tools 3.2.0.CR1, PostgreSQL 8.2.5


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 15, 2008 1:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
depends - if you can reproduce it with hibernate core (via hbm.xml) then it should go to hibernate core - if only visible when using annotations report should go into ANN

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.