Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to reuse index rows in JPA server #1133

Merged
merged 4 commits into from Dec 6, 2018
Merged

Try to reuse index rows in JPA server #1133

merged 4 commits into from Dec 6, 2018

Conversation

jamesagnew
Copy link
Collaborator

No description provided.

}

T entityToReuse = theIndexesToRemove.remove(theIndexesToRemove.size() - 1);
entityToReuse.populateFrom(theIndexesToAdd.get(addIndex));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using a populateFrom() strategy runs the risk of missing data if new fields are added in the future. This risk could be avoided by copying the id from entityToReuse to theIndexesToAdd.get(addIndex). Might need to do some hibernate magic if we're in session (detach / reattach type stuff).

@jamesagnew jamesagnew merged commit cbaa39f into master Dec 6, 2018
@jamesagnew jamesagnew deleted the reuse_indexes branch December 6, 2018 00:26
@coveralls
Copy link

coveralls commented Dec 8, 2018

Coverage Status

Coverage decreased (-0.004%) to 74.512% when pulling 1357627 on reuse_indexes into 31f6a0b on master.

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.

None yet

3 participants