-->
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.  [ 3 posts ] 
Author Message
 Post subject: API to get all supported dialects
PostPosted: Thu Jan 24, 2008 7:18 pm 
Newbie

Joined: Thu Jan 24, 2008 7:10 pm
Posts: 3
I want to list all the supported dialect classes in a ComboBox. Is there an API to get all the supported Dialects? Thanks!

Dongmei


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 25, 2008 4:13 am 
Newbie

Joined: Tue Jan 15, 2008 10:07 am
Posts: 14
Well, if you browse the API documentation there's an object called DialectFactory in the org.hibernate.dialect package, that can be used to build Dialect objects, so logically it should have some knowledge of what dialects are available for creation. You can't retrieve this information via its public API though. However, if you view the source code of DialectFactory it contains a private Map (HashMap) that maps database engines to their respective Dialect classes - accompanied by a nice little TODO that suggest this information may be moved to a public properties file in the future. I think for now your best bet would be to retrieve this Map via reflection, as it seems to contain exectly the information you are after.

Edit: Having taken a closer look, this Map doesn't contain all the available Dialects afterall. Well, so much for that idea :)


Top
 Profile  
 
 Post subject: API to get all supported dialects
PostPosted: Fri Jan 25, 2008 1:54 pm 
Newbie

Joined: Thu Jan 24, 2008 7:10 pm
Posts: 3
Thanks for the try and information. I guess I'll hard code the dialect classes into a String[] for now.

Dongmei


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