Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.252
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol 5.0.251
  HXTT DBF 7.1.252
  HXTT Excel 6.1.255
  HXTT Json 1.0.223
  HXTT Paradox 7.1.251
  HXTT PDF 2.0.251
  HXTT Text(CSV) 7.1.251
  HXTT Word 1.1.251
  HXTT XML 4.0.252
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT ACCESS
Grails with HXTT Access
Gordon Rehling
2010-07-08 09:12:14
I am using Grails 1.2.1, JDK 1.6.18 and trial version of HXTT Access.

I have defined the following domain class
class User {
// Fields
String userName
String userId
String password
static constraints = {
}
}

When I run the application, with the configuration pointing to an empty Access database, the Grails "magic" creates an Access table called user, with fields for each class member, plus the id and version fields i.e.
id Number, Decimal, 20
version Number, Decimal
user_name Text
user_id Text
password Text

When you try to add a record via Grails everything collapses.

However, if you manually change the first field to autonumber, everything is OK.
id AutoNumber

I believe that this is probably because HXTT is generating Decimal when we need Long Integer.

I can't see this the Dialect file... am I missing something, or has anyone found a workaround?

Gordon
Re:Grails with HXTT Access
HXTT Support
2010-07-08 09:28:58
In HxttAccessDialect.java(which is at http://www.hxtt.com/hibernate.html>
you will find
registerColumnType( Types.BIGINT, "numeric(19,0)" ); // MS Access DON'T SUPPORT BIGINT
you can try
registerColumnType( Types.BIGINT, "int" ); // MS Access DON'T SUPPORT BIGINT

>However, if you manually change the first field to autonumber, everything is OK.
>id AutoNumber
HXTT Access supports "ID int auto_increment" syntax.

Re:Re:Grails with HXTT Access
Gordon Rehling
2010-07-12 05:39:57
I have made the change you suggested, but am struggling to re-compile the class... error message is "Cannot access org.hibernate.dialect.dialect".

My directory structure is
src/com/hxtt/support/hibernate/*.java

hibernate3.jar is in the CLASSPATH

Error occurs when I sit in src directory and say
javac 'com/hxtt/support/hibernate/HxttAccessDialect.java'

Could you suggest what I am doing wrong, or compile a replacement class file for me please?

I know that you suggest "int", but in Access the id fields are "long"... perhaps this would work better?

Regards,

Gordon
Re:Re:Re:Grails with HXTT Access
HXTT Support
2010-07-12 06:30:59
>Could you suggest what I am doing wrong, or compile a replacement class file
>for me please?
Now you download http://www.hxtt.com/test/hibernate.jar or http://www.hxtt.com/test/hibernate.zip

>I know that you suggest "int", but in Access the id fields are "long"...
>perhaps this would work better?
Yeah. MS Access' long type is int type in fact. Changed according to your suggestion.
Re:Re:Re:Re:Grails with HXTT Access
Gordon Rehling
2010-07-12 07:54:11
Thank you for the updated hibernate.zip

I have used this and it works perfectly! I can create a Groovy class within Grails, compile it and run against an empty MS Access database... and it all appears to work in the same way as if I run the code against an empty MySQL database.

I would like to say a big thank you for the excellent support that you have provided so far. I still have more testing to do, but things are looking good so far!

Just to clarify, is the change of BigInt to Int a permanent change in your code, or just a special version for me, please?

Gordon
Re:Re:Re:Re:Re:Grails with HXTT Access
HXTT Support
2010-07-12 08:04:13
>is the change of BigInt to Int a permanent change in your code
Permanent change.

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap