Sonntag, 20. Mai 2007

Hibernate, MySQL und Microsoft Access

Verwendet man bei Hibernate als ID-Definition dies

<id name="id">
<generator class="hilo"/>
</id>

so erzeugt Hibernate hierfür automatisch BIGINT(20) Spalten, wenn MySQL verwendet wird. Diese funktionieren nicht im Microsoft Access auf Grund eines bekannten und bisher nicht behobenen Fehlers:

"The Microsoft Jet database engine incorrectly maps the BigInt data type to a Binary data type."

will man trotzdem Microsoft Access verwenden, muss man den Typ der Spalte manuell auf etwas ändern, mit dem Access klar kommt:

ALTER TABLE CHANGE COLUMN id id INT(10) NOT NULL AUTO_INCREMENT;

Keine Kommentare: