It may seem odd, but I'd like to use hibernate with Excel spreadsheets. I'm trying to work through a simple test, but I'm unable to save any new objects to the spreadsheet.
After turning off transactions, I can select rows, but when I try to create a new object and save it, I do not receive an error, but nothing is saved.
I'm getting a Connection that I create from Session.open() (since I had no luck setting this up through the regular configuration route).
I'm using Sun's sun.jdbc.odbc.JdbcOdbcDriver driver.
The spreadsheet has two columns "message_id" and "message_text" (this example is from Chapter 2 of
Hibernate In Action ). I removed the 'next_message_id" column from the example, however.
I'm using the Message class as shown in the book minus the
nextMessage property.
Here's the simple mapping file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<class
name="hello.Message"
table="[MESSAGES$]">
<id
name="id"
column="message_id">
<generator class="increment"/>
</id>
<property
name="text"
column="message_text">
</property>
</class>
</hibernate-mapping>
Any ideas on how to make this work? Thank you.