Joined: Thu Nov 11, 2004 3:24 pm Posts: 17
|
|
I tried the following code
Session session = PBGManagerBase.getHibernateSession();
Transaction tx = session.beginTransaction();
Note note1 = new Note();
note1.setNoteId(10);
note1.setNoteText(Hibernate.createClob(" "));
session.save(note1);
session.flush();
session.refresh(note1,LockMode.UPGRADE);
oracle.sql.CLOB clob = (oracle.sql.CLOB) note1.getNoteText();
java.io.Writer pw = clob.getCharacterOutputStream();
pw.write("This is a test clob data inserted using hibernate");
pw.close();
tx.commit();
PBGManagerBase.closeHibernateSession();
In this the line session.save(note1) gives me an error
"Unhandled Exception thrown: class java.lang.UnsupportedOperationException"
In my mapping (Note.hbm.xml and Note.java) file the type for attribute noteText is java.sql.Clob.
Can anyone help
|
|