-->
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.  [ 1 post ] 
Author Message
 Post subject: Customising Queries for a very simple DB
PostPosted: Thu Sep 17, 2009 8:10 am 
Newbie

Joined: Thu Sep 17, 2009 7:36 am
Posts: 1
Hi there,

this is my first post ever in the forum. Nice to meet you all.

How do I change the Queries created by the SchemaGenerator class? I got a really simple JDBC Driver ( don't even support the NOT NULL statement) that can't parse the regular queries. I want to use the hbm2dll feature of Hibernate but it need to be compatible with my simplistic DBM.

I created my own dialect that resolved some of the incompatibilities (like supported sql types and functions) but I still need to do a lot of customization.

Here is the error that I'm getting.
Code:
ERROR SchemaExport:114 - Unsuccessful: create table MESSAGES (MESSAGE_ID integer not null, MESSAGE_TEXT varchar, NEXT_MESSAGE_ID integer, primary key (MESSAGE_ID))
     [java] ERROR SchemaExport:114 - Error in statement [create table MESSAGES (MESSAGE_ID integer not null, MESSAGE_TEXT varchar, NEXT_MESSAGE_ID integer, primary key (MESSAGE_ID))]; Cause: com.j_spaces.jdbc.parser.grammar.ParseException: Encountered " "not" "not "" at line 1, column 43.
     [java] Was expecting one of:
     [java]     "default null" ...
     [java]     "index" ...
     [java]     "primary key" ...
     [java]     ")" ...
     [java]     "," ...


This query is generated by the method 'sqlCreateString(Dialect dialect, Mapping p, String defaultCatalog, String defaultSchema)' in 'org.hibernate.mapping.Table'.

Do I have to subclass it and implement my own method? But then I would need to chance the class 'org.hibernate.cfg.Configuration' as well and so on all the way up.

Is there a easier way to do it?

My libs versions.
Code:
     
     [java]  INFO Version:94 - Hibernate EntityManager 3.2.0.CR1
     [java]  INFO Version:94 - Hibernate Annotations 3.2.0.CR1
     [java]  INFO Environment:94 - Hibernate 3.2 cr2


Thank you very much in advance.


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

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.