Skip to content

Conversation

schauder
Copy link
Contributor

For mutable entities this avoids superfluous setting of attributes.
For imutables without "Wither"s this avoids failures due to not being able to set a property.

…nstructor.

For mutable entities this avoids superfluous setting of attributes.
For imutables without "Wither"s this avoids failures due to not being able to set a property.
@@ -73,8 +74,14 @@ public T mapRow(ResultSet resultSet, int rowNumber) {

Object id = idProperty == null ? null : readFrom(resultSet, idProperty, "");

PreferredConstructor<T, RelationalPersistentProperty> persistenceConstructor = entity.getPersistenceConstructor();
Copy link
Member

Choose a reason for hiding this comment

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

We should avoid the iteration over the properties entirely by returning the just created instance if PersistentEntity.requiresPropertyPopulation() is false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

… all.

This avoids needless iterating over the properties for instances fully constructed by their constructor.
odrotbohm pushed a commit that referenced this pull request Aug 21, 2018
…ted.

The entity creation not skips the property population entirely if the metamodel indicates that the instantiation already creates a complete entity. If there's need to actively populate properties, we now correctly skip the ones already consumed by the constructor.

Original pull request: #86.
odrotbohm added a commit that referenced this pull request Aug 21, 2018
Original pull request: #86.
@odrotbohm odrotbohm closed this Aug 21, 2018
@odrotbohm odrotbohm deleted the issue/DATAJDBC-252 branch August 21, 2018 09:10
mp911de pushed a commit that referenced this pull request Feb 21, 2022
This commit is a follow-up of gh-63.

Original pull request: #86.
mp911de pushed a commit that referenced this pull request Feb 21, 2022
Convert idents to tabs. Fix Kotlin extensions formatting.

Original pull request: #86.
mp911de added a commit that referenced this pull request Feb 21, 2022
Remove unused imports.

Original pull request: #86.
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.

2 participants