Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
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
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT ACCESS
Grails with HXTT Access
Gordon Rehling
2010-07-08 09:12:14.0
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.0
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.0
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.0
>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.0
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.0
>is the change of BigInt to Int a permanent change in your code
Permanent change.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap