[hibernate-issues] [JIRA] (HHH-4233) cant bind a child using mappedby relating to a parent attribute(polymorphism)

Steve Ebersole (JIRA) jira at hibernate.atlassian.net
Mon May 11 08:42:51 EDT 2020


Steve Ebersole ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aaafa2e9a-7a21-4c62-bf4a-050acb31276c ) *commented* on HHH-4233 ( https://hibernate.atlassian.net/browse/HHH-4233?atlOrigin=eyJpIjoiODI3MjBhM2EwNzM3NDAyYmJkODZmOGJkYjgyMzQxOGUiLCJwIjoiaiJ9 )

Re: cant bind a child using mappedby relating to a parent attribute(polymorphism) ( https://hibernate.atlassian.net/browse/HHH-4233?atlOrigin=eyJpIjoiODI3MjBhM2EwNzM3NDAyYmJkODZmOGJkYjgyMzQxOGUiLCJwIjoiaiJ9 )

Can we stop with these inane “well JPA provider X” does it? I can’t think of any other argument that makes me want to do something less. Either you are claiming Hibernate violates the spec or simply trying some kowtow technique to force to do something I guess? Considering Hibernate passes all JPA TCK tests, hard to be #1.

That said…

I am not able to reproduce this. I took this psuedo-model and was able to use it just fine:

	@Entity( name = "Person" )
	@Table( name = "persons" )
	public static class Person {
		@Id
		private Integer id;

		private String name;

		@OneToMany( cascade = CascadeType.ALL, mappedBy = "owner" )
		private List<Cat> cats = new ArrayList<>();
	}

	@Entity( name = "Mammal" )
	@Table( name = "mammals" )
	@Inheritance( strategy = InheritanceType.JOINED )
	public static class Mammal {
		@Id
		private Integer id;

		private String name;

		@ManyToOne
		@JoinColumn( unique = true )
		private Person owner;
	}

	@Entity( name = "Cat" )
	@Table( name = "cats" )
	public static class Cat extends Mammal {
		private boolean polydactyl;
	}

	@Entity( name = "Dog" )
	@Table( name = "dogs" )
	public static class Dog extends Mammal {
		private boolean akcRecognized;
	}

So going to need a reproducer.

I looked at this because Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A0222998d-a0c8-4789-91ec-6a92d10dfb9a ) asked me to. Please open a new issue with a test that actually reproduces this and link it here

( https://hibernate.atlassian.net/browse/HHH-4233#add-comment?atlOrigin=eyJpIjoiODI3MjBhM2EwNzM3NDAyYmJkODZmOGJkYjgyMzQxOGUiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-4233#add-comment?atlOrigin=eyJpIjoiODI3MjBhM2EwNzM3NDAyYmJkODZmOGJkYjgyMzQxOGUiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100126- sha1:454696e )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200511/513e7216/attachment.html 


More information about the hibernate-issues mailing list