-->
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: Custom Dialect with Eclipse Generation
PostPosted: Fri Apr 01, 2005 7:31 pm 
Newbie

Joined: Fri Apr 01, 2005 7:22 pm
Posts: 1
I am using the alpha version of the Hibernate 3 tools.

I am attempting to use a custom dialect for Oracle in order to handle the NVARCHAR2 Oracle type. I have created a subclass of the Oracle9Dialect class, added the constructor:

public Oracle10gDialectWithNVARCHAR2() {
super();
registerColumnType( Types.VARCHAR, "nvarchar2" );
}

I jar'ed this up, placed it in the org.hibernate.eclipse_3.0.0.alpha directory and edited the plugin.xml file. For good measure, I did the same thing in the org.hibernate.eclipse.mapper_3.0.0.alpha plugin directory.

I used my new dialect class in the hibernate.cfg.xml file. The generation occurs (and I know it is using my new class, because if I remove it from the plugin directory, I get an error when I attempt to generate). Everything appears to work fine, however the .hbm.xml files do not have NVARCHAR2 columns mapped to java.lang.String, but to java.lang.Object.

Am I barking up the wrong tree? I want the generation to create these column types as strings. Not sure what to do here...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 02, 2005 3:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
a coupe of things here:

if should not be necessary to put your dialect into the plugin directory. You should be able to just define it in your projects classpath.

The other is that the dialect does not control how mappings are reverse engineered - they control the "forward engineering" (namely schemaexport)

at the moment you cannot control this in configuration - only in the code of the tool. we will add this in alpha 3.

_________________
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.  [ 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.