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.  [ 2 posts ] 
Author Message
 Post subject: Escaping Keywords for different dialects
PostPosted: Mon Aug 21, 2006 12:50 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 4:08 pm
Posts: 28
I don't see any mention of this in the documentation, but I've got a property named 'Schema' on my Table class. On SQL Server 2005 (and maybe other versions) schema is a keyword so I have to map the property as:

Code:
<property name="Schema" column="[Schema]" length="256" not-null="true" />


Is the dialect supposed to fix that sort of stuff for us or will [Schema] work for all engines? I don't know if that's how mysql escapes keywords for instance. (I'm using the 1.2 alpha build, so didn't know if this might be a bug). Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 21, 2006 2:24 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
Use backtics (`) instead of square brackets.

Symon.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.