Limitations Of The Hibernate Backend

The default schema used by the hibernate back-end uses the Hibernate 'string' property type for all string data. Hibernate will translate this into a VARCHAR (or Oracle VARCHAR2) field of a maximum length appropriate to the database. For MySQL, this means VARCHAR(255). This maximum length affects:

Depending upon the database you connect to and the type of data you anticipate storing in the topic map database, you may wish to modify these values. To do so, you must edit the mapping files found in the directory src/org/tm4j/topicmap/hibernate. The mapping files involved are TopicMapObjectDataObject.hbm.xml and LocatorDataObject.hbm.xml. Simply search these files for the string 'type="string"' and add to the elements that contain this attribute an additional attribute 'length="xxx"' where xxx is your desired maximum string length. Having done this, you must run the ant target 'hibernate.install-mappings' to copy these XML files into the build/classes directory, and then run the target 'hibernate-jar' to build the JAR file for the back-end. Finally, rerun the InstallDB application as described in the section called “Installing The Database Schema” to update the database schema. You should check the output of this application carefully to ensure that the database schema update did not fail due to any changes you made.