On Tue, Apr 28, 2015 at 05:13:55PM +0200, Oliver Goldschmidt wrote:
> Thanks again, but I guess that's not all. Changing m_text_value to
> m.text_value in the EPerson class is still throwing an NPE, because the
> SQL query is still not correct:
> 2015-04-28 17:04:36,075 DEBUG org.dspace.storage.rdbms.DatabaseManager @
> Running query "SELECT * FROM eperson e ORDER BY ?" with parameters:
> m.text_value
Um, can one use parameters that way in SQL? I thought not. Shouldn't
this be done by composing the SELECT using string concatenation? We
don't get "m.text_value" from the user, do we?
> I can't sort on a field from table m, when table m is not involved in
> the query.
You're quite right: "m" is not defined in the statement. Guessing
from the name, I'd say this was meant to be ordering a select from
metadatavalue, since that is the only table which has a 'text_value'
column.
[digs through the code]
Something is quite wrong. The query at EPerson line 518 is:
SELECT * FROM eperson e
LEFT JOIN metadatavalue m on (m.resource_id = e.eperson_id and
m.resource_type_id = ? and m.metadata_field_id = ?)
ORDER BY ?
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu