I have a joined-subclass where I want to "upgrade" the superclass to the subclass. I cannot delete the superclass because of constaints and I also cannot evict the superclass and persist the subclass because the subclass is in the database already
One solution is to update using plain sql, but the sql is never commited.
I can see that posgres is prepering the insert statement
See code below.
Does anybody hav an idea how to upgrade the subclass? or why I cannot commit?
I am using xdoclet which is limiting my mapping options
I am using jboss4.0.3SP1
Hibernate version:
3.1
Mapping documents:
xdoclet-hibernate-module 1.2.3
Code between sessionFactory.openSession() and session.close():
Code:
getSession().flush();
try {
Session mySession = getSession().getSessionFactory().openSession();
Transaction transaction = mySession.beginTransaction();
Connection conn = mySession.connection();
Statement stmt = conn.createStatement();
String sql = "insert into the_table(id, description, category_name) values(444444,'de','na')";
int rows = stmt.executeUpdate(sql);
conn.commit();
transaction.commit();
stmt.close();
mySession.flush();
mySession.close();
} catch (SQLException e) {
e.printStackTrace();
}
Full stack trace of any exception that occurs:
Name and version of the database you are using:
PostgreSQL\8.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
[code]