Commit dd5b0768 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Fix types of columns for PostgreSQL compatibility

parent f04d099f
...@@ -32,7 +32,7 @@ public class MoodleConnectorDaoImpl implements ConnectorDao { ...@@ -32,7 +32,7 @@ public class MoodleConnectorDaoImpl implements ConnectorDao {
+ "JOIN mdl_user_enrolments ON (mdl_user.id = mdl_user_enrolments.userid) " + "JOIN mdl_user_enrolments ON (mdl_user.id = mdl_user_enrolments.userid) "
+ "JOIN mdl_enrol ON (mdl_user_enrolments.enrolid = mdl_enrol.id) " + "JOIN mdl_enrol ON (mdl_user_enrolments.enrolid = mdl_enrol.id) "
+ "WHERE mdl_enrol.courseid = ?;", + "WHERE mdl_enrol.courseid = ?;",
new String[] {courseid}, new Object[] {Long.valueOf(courseid)},
new RowMapper<String>() { new RowMapper<String>() {
@Override @Override
public String mapRow(ResultSet resultSet, int row) throws SQLException { public String mapRow(ResultSet resultSet, int row) throws SQLException {
...@@ -57,7 +57,7 @@ public class MoodleConnectorDaoImpl implements ConnectorDao { ...@@ -57,7 +57,7 @@ public class MoodleConnectorDaoImpl implements ConnectorDao {
+ "ON (mdl_course.id = mdl_context.instanceid AND mdl_course.visible = 1) " + "ON (mdl_course.id = mdl_context.instanceid AND mdl_course.visible = 1) "
+ "WHERE mdl_context.contextlevel = 50 AND mdl_enrol.courseid = ? AND mdl_user.username = ? " + "WHERE mdl_context.contextlevel = 50 AND mdl_enrol.courseid = ? AND mdl_user.username = ? "
+ "ORDER BY roleid ASC;", + "ORDER BY roleid ASC;",
new String[] {courseid, username}, new Object[] {Long.valueOf(courseid), username},
new RowMapper<Membership>() { new RowMapper<Membership>() {
@Override @Override
public Membership mapRow(ResultSet resultSet, int row) throws SQLException { public Membership mapRow(ResultSet resultSet, int row) throws SQLException {
...@@ -92,7 +92,7 @@ public class MoodleConnectorDaoImpl implements ConnectorDao { ...@@ -92,7 +92,7 @@ public class MoodleConnectorDaoImpl implements ConnectorDao {
@Override @Override
public Course mapRow(ResultSet resultSet, int row) throws SQLException { public Course mapRow(ResultSet resultSet, int row) throws SQLException {
Course course = new Course(); Course course = new Course();
course.setId(resultSet.getString("id")); course.setId(String.valueOf(resultSet.getLong("id")));
course.setFullname(resultSet.getString("fullname")); course.setFullname(resultSet.getString("fullname"));
course.setShortname(resultSet.getString("shortname")); course.setShortname(resultSet.getString("shortname"));
course.setType(TYPE); course.setType(TYPE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment