Skip to content

Conversation

@THD-Thomas-Lang
Copy link
Contributor

@schauder schauder changed the title Datajdbc 341 DDATAJDBC-341 - Map NULL values in EntityRowMapper for columns not being fetched in the query Oct 16, 2019
@schauder schauder changed the title DDATAJDBC-341 - Map NULL values in EntityRowMapper for columns not being fetched in the query DATAJDBC-341 - Map NULL values in EntityRowMapper for columns not being fetched in the query Oct 16, 2019
Copy link
Contributor

@schauder schauder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when running all the tests I get tons of NPE. I didn't even check why. Those obviously have to go.

The general direction looks good.

* @author Mark Paluch
* @author Jens Schauder
* @author Christoph Strobl
* @since 1.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to use a formatter so that formatting and ordering of annotation/imports does not get changed.

propertyAccessor.setProperty(property, readOrLoadProperty(idValue, property));
}
} catch (SQLException e) {
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never ever print directly to console. Always use proper logging, with a meaningful message.
In general Exceptions shouldn't get ignored. In the rare cases where this is actually what we want pleas add a comment, why this is the right thing to do.

value = getObjectFromResultSet(path.extendBy(property).getColumnAlias());
}
} catch (SQLException e) {
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above.

try {
return resultSet.getObject(backreferenceName);
} catch (SQLException o_O) {
//throw new MappingException(String.format("Could not read value %s from result set!", backreferenceName), o_O);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I don't think we should ignore exceptions.
If a column is not in the result set we should not ask for it and if it is and exception should actually get propagated.

schauder pushed a commit that referenced this pull request Mar 19, 2020
…ng fetched in the query.

Original pull request: #170.
schauder pushed a commit that referenced this pull request Mar 30, 2020
…ng fetched in the query.

Original pull request: #170.
@mp911de
Copy link
Member

mp911de commented Mar 31, 2020

Thank you for your contribution. That 's merged and polished via #201.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants