-->
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: MySQL backticks
PostPosted: Tue Dec 02, 2008 7:15 pm 
Newbie

Joined: Tue Dec 02, 2008 6:57 pm
Posts: 3
I have been using the MyEclipseIDE to reverse engineer a set of hibernate 3.2 data objects and DAO's using Annotations.

My issue revolves around adding MySQL backticks (`) to table, catalog and column names in order to insure that MySQL queries run properly in situations where names conflict with SQL keywords.

Upon reading the JIRA issue:

http://opensource.atlassian.com/project ... e/HHH-2660

I have taken the course of using a 'fixup' script after object generation to insure that the identifiers are backticked properly.

In HHH-2660 it seems that the developer stance is to add these backticks to the mappings or annotations.

My question is: Should SQL Vendor specific code be added to the mappings this way? This makes the Hibernate mappings configuration non-cross platform!

It seems to me that this should be handled by Hibernate when the MySQLDialect is used.

Any thoughts?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2008 12:00 pm 
Regular
Regular

Joined: Fri May 12, 2006 4:05 am
Posts: 106
If you enclose the identifier in backticks in your mapping hibernate should generate SQL using the correct identifier depending on the dialect used - so nothing DB-specific here....

Regards

piet


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.