Hi,
I'm experimenting with hibernate and MySQL 5.0. I have been trying to see if I can define a loader that uses a MySQL 5.0 stored procedure. Unfortunately, I get the following error:
Code:
[java] Exception in thread "main" java.lang.UnsupportedOperationException: org.hibernate.dialect.MySQLDialect does not support
resultsets via stored procedures
This is in hibernate 3.1rc3. If I change the dialect to SQLServerDialect the loader works fine, but of course that could mess up other mappings.
So I hacked the MySQLDialect.java file to more resemble the SQLServerDialect file.
Added the following imports:
Code:
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
and the following methods:
Code:
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
return col;
}
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
boolean isResultSet = ps.execute();
while (!isResultSet && ps.getUpdateCount() != -1) {
isResultSet = ps.getMoreResults();
}
ResultSet rs = ps.getResultSet();
return rs;
}
That seemed to work. I'm new to hibernate, how would I go about registering a formal change request to get this support in the official release?
Thanks,
Guy