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

HSEARCH-2433 AssertionFailure with providedId in embeddeds #1200

Closed
wants to merge 2 commits into from

Conversation

yrodiere
Copy link
Member

https://hibernate.atlassian.net/browse/HSEARCH-2433

Details in the commit comments.

@@ -427,37 +430,57 @@ private Annotation getIdAnnotation(XProperty member, TypeMetadata.Builder typeMe
return idAnnotation;
}

private void initializeProvidedIdMetadata(ProvidedId providedId, XClass clazz, TypeMetadata.Builder typeMetadataBuilder) {
private void initializeProvidedIdMetadata(String prefix, ProvidedId providedId, XClass clazz, TypeMetadata.Builder typeMetadataBuilder,
boolean isRoot, PathsContext pathsContext, ParseContext parseContext) {
PropertyMetadata propertyMetadata;
Copy link
Member

Choose a reason for hiding this comment

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

I know it's preexisting to your patch but we should probably move this declaration to where it is used. It makes no sense to have it here.

typeMetadataBuilder.idProperty( propertyMetadata );

if ( isRoot ) {
typeMetadataBuilder.idProperty( propertyMetadata );
Copy link
Member

Choose a reason for hiding this comment

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

Mmmmh, did I miss something or if !isRoot, the whole work we did above was totally useless?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, there's something wrong in here. I'll see what I can do (probably just add a else)

@Sanne
Copy link
Member

Sanne commented Oct 28, 2016

@yrodiere you mention on the JIRA comments that this problem affects the Lucene backend as well.

Worth moving the test to -engine ?

@yrodiere
Copy link
Member Author

@Sanne Yes, I'll see if I can highlight the issue in an -engine test.

@Sanne
Copy link
Member

Sanne commented Oct 28, 2016

I meant to suggest to move this one, not to add an additional one. We don't want to have too many redundant tests checking for the same things ;)

@yrodiere
Copy link
Member Author

@Sanne I'll move to -orm, then. -engine tests are not yet executed on Elasticsearch. Not even sure yet when they will be...

@Sanne
Copy link
Member

Sanne commented Oct 31, 2016

I'll move to -orm, then. -engine tests are not yet executed on Elasticsearch.

Right, forgot about that. Let's merge this then, the missing test for the embedded mode is an orthogonal issue.

There were three issues:

 * The prefix was not used on the providedId field, potentially
   resulting in root type provided ID being erased by embeddeds' provided
   IDs
 * The providedId was being added unconditionally for embeddeds, not
   respecting settings like @IndexedEmbedded.includeEmbeddedObjectIds
 * The field bridge was not ignored as required when creating metadata
   for containedIn
@yrodiere
Copy link
Member Author

@Sanne I rebased on master: the build was failing because of https://hibernate.atlassian.net/browse/HSEARCH-2438 , which was merged to master a few minutes ago

@yrodiere
Copy link
Member Author

@gsmet I addressed your concerns. Thanks!

@Sanne
Copy link
Member

Sanne commented Oct 31, 2016

merged, thanks all!

@Sanne Sanne closed this Oct 31, 2016
@yrodiere yrodiere deleted the HSEARCH-2433 branch October 31, 2016 13:22
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