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

#26 Create AnnotationUsage for tenant-id in XML #62

Closed
wants to merge 57 commits into from

Conversation

dreab8
Copy link
Collaborator

@dreab8 dreab8 commented Nov 2, 2023

#26

@sebersole I changed mapping-3.1.0.xsd and moved <xsd:element name="tenant-id" type="orm:tenant-id" minOccurs="0" /> inside <xsd:complexType name="attributes">, not sure if this is correct

sebersole and others added 30 commits October 16, 2023 09:23
Add Action to build/test

Signed-off-by: Steve Ebersole <[email protected]>
Signed-off-by: Steve Ebersole <[email protected]>
Signed-off-by: Steve Ebersole <[email protected]>
sebersole#47 - Support dynamic <entity/> and <embeddable/> mappings
sebersole#47 - Support dynamic <entity/> and <embeddable/> mappings
sebersole#47 - Support dynamic <entity/> and <embeddable/> mappings
sebersole#47 - Support dynamic <entity/> and <embeddable/> mappings
@dreab8 dreab8 requested a review from sebersole November 2, 2023 15:12
@sebersole
Copy link
Owner

I was consciously keeping it outside of <attributes/>. My thought process was that it is a special attribute.

But then again, it's on par (I'd say) with <version/> which JPA defined inside <attributes/>, so I guess I'm fine with changing it.

MutableClassDetails mutableClassDetails,
AccessType classAccessType,
SourceModelBuildingContext sourceModelBuildingContext) {
processAttributes( attributesContainer, mutableClassDetails, classAccessType, null, sourceModelBuildingContext );
}

public static void processAttributes(
JaxbAttributesContainerImpl attributesContainer,
Copy link
Owner

Choose a reason for hiding this comment

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

I think I might be missing something in the diff here, but why is this only processing basic attributes and tenant-id? Why not the others?

Unless I am very confused, this all used to route through #processBaseAttributes (base, not basic)

Copy link
Collaborator Author

@dreab8 dreab8 Nov 2, 2023

Choose a reason for hiding this comment

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

I think the nameprocessBasicAttributes is just a really bad choice I made and really misleading :(.
It really process the attributes JaxbAttributesContainerImpl and JaxbEmbeddableAttributesContainerImpl have in common.

Copy link
Owner

Choose a reason for hiding this comment

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

So then maybe you are just calling the wrong one?

	public static void processBaseAttributes(
			JaxbBaseAttributesContainer attributesContainer,
			MutableClassDetails mutableClassDetails,
			AccessType classAccessType,
			MemberAdjuster memberAdjuster,
			SourceModelBuildingContext sourceModelBuildingContext) {

^^ is the one I think you are thinking of

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In order to process the additional tenant-id attributes that JaxbAttributesContainerImpl has respect to JaxbEmbeddableAttributesContainerImpl , I renamed the existing processAttributes method into processBasicAttributes (poor name choice) and created 2 new methodsprocessAttributes(JaxbAttributesContainerImpl attributesContainer, ...) and processAttributes(JaxbEmbeddableAttributesContainerImpl attributesContainer, ...
in this way processAttributes(JaxbAttributesContainerImpl attributesContainer, ...) can process the tenant-id attribute and both methods can use the processBasicAttributes to process all the other attributes JaxbAttributesContainerImpl and JaxbEmbeddableAttributesContainerImpl have in common.
Hope my explanation is not too confusing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

renamed it to processAttributeContainer but open to better suggestions

@sebersole
Copy link
Owner

I moved the xsd and jaxb changes back to hibernate-orm (my jpa32 branch). We'll need to apply those related changes there if they still need to be. They are unfortunately the files in conflict

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