Its still not working unfortunately. I use the backtick, which on my keyboard is on the same key as the tilde (~) character.
Here is the generated SQL after setting the property to TRUE
Hibernate: insert into SpecimenSource ([freeText], nameOrCodeCode, nameOrCodeDescription, nameOrCodeCodingSystem, id) values (?, ?, ?, ?, ?)
The exception trace
org.dbunit.dataset.DataSetException: java.sql.SQLException: [CONTRACT1]Incorrect syntax near the keyword 'freeText'.
at org.dbunit.database.DatabaseDataSet.getTable(DatabaseDataSet.java:234)
at com.orchestral.cdr.CDRDBBaseImpl.assertTableAsExpected(CDRDBBaseImpl.java:138)
at com.orchestral.cdr.PersistPatientTest.testSpecimenSource(PersistPatientTest.java:162)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
java.sql.SQLException: [CONTRACT1]Incorrect syntax near the keyword 'freeText'.
at com.inet.tds.e.a(Unknown Source)
at com.inet.tds.e.a(Unknown Source)
at com.inet.tds.a.if(Unknown Source)
at com.inet.tds.a.do(Unknown Source)
at com.inet.tds.a.executeQuery(Unknown Source)
at org.dbunit.database.AbstractResultSetTable.<init>(AbstractResultSetTable.java:91)
at org.dbunit.database.ForwardOnlyResultSetTable.<init>(ForwardOnlyResultSetTable.java:50)
at org.dbunit.database.CachedResultSetTable.<init>(CachedResultSetTable.java:47)
at org.dbunit.database.CachedResultSetTableFactory.createTable(CachedResultSetTableFactory.java:46)
at org.dbunit.database.DatabaseDataSet.getTable(DatabaseDataSet.java:230)
at com.orchestral.cdr.CDRDBBaseImpl.assertTableAsExpected(CDRDBBaseImpl.java:138)
at com.orchestral.cdr.PersistPatientTest.testSpecimenSource(PersistPatientTest.java:162)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
The mapping file :
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.orchestral.cdr.element.SpecimenSource">
<id type="int" unsaved-value="null">
<column name="id"/>
<generator class="increment"/>
</id>
<property name="freeText" column="`freeText`"/>
<property name="nameOrCodeCode" column="nameOrCodeCode"/>
<property name="nameOrCodeDescription" column="nameOrCodeDescription"/>
<property name="nameOrCodeCodingSystem" column="nameOrCodeCodingSystem"/>
</class>
</hibernate-mapping>
Other config properties
hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
hibernate.connection.driver_class=com.inet.tds.TdsDriver
hibernate.connection.url=jdbc:inetdae:CONTRACT1:1433?database=CDRAaron&sql7=true
Thanks for any assistance.
|