[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (HHH-4358) Having to use @ForceDiscriminator kind of breaks JPA compatibility
Karsten Wutzke (JIRA)
noreply at atlassian.com
Tue Dec 20 15:41:19 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44647#comment-44647 ]
Karsten Wutzke edited comment on HHH-4358 at 12/20/11 2:39 PM:
---------------------------------------------------------------
OK I probably misunderstood the "making fun of". Winter is not my time honestly. :(
Thanks for the insight, but I still don't see why Hibernate doesn't simply persist a discriminator. How would I get Hibernate to do it now as a workaround?
If I understand correctly JOINED inheritance simply uses joins on sub entities to determine the actual type (only disjoint inheritance supported), which can't work for SINGLE_TABLE. That's all that came to my mind. I'm mostly flooded trying to solve business problems.
In the end it's hard to explain to a customer when you recommend Hibernate as a OR mapper and it doesn't simply do the things you'd expect (Michael's "assumed thing" that I concur with). My customer first thought I was doing something wrong with Hibernate, then they thought I recommended the wrong tool... not good in any case, y'know...
I will open an RFE then. Thanks for your patience.
was (Author: kwutzke):
OK I probably misunderstood the "making fun of". Winter is not my time honestly. :(
Thanks for the insight, but I still don't see why Hibernate doesn't simply persist a discriminator. How would I get Hibernate to do it now as a workaround?
If I understand correctly JOINED inheritance simply uses joins on sub entities to determine the actual type (only disjoint inheritance supported), which can't work for SINGLE_TABLE. That's all that came to my mind. I'm mostly flooded trying to solve business problems.
In the end it's hard to explain to a customer when you recommend Hibernate as a OR mapper and it doesn't simply do the things you'd expect (Michael's "assumed thing" I concur with). My customer first thought I was doing something wrong with Hibernate, then they thought I recommended the wrong tool... not good in any case, y'know...
I will open an RFE then. Thanks for your patience.
> Having to use @ForceDiscriminator kind of breaks JPA compatibility
> ------------------------------------------------------------------
>
> Key: HHH-4358
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4358
> Project: Hibernate Core
> Issue Type: Improvement
> Components: annotations
> Environment: JPA
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Labels: jpa2
> Fix For: 4.0.1
>
>
> According to
> http://opensource.atlassian.com/projects/hibernate/browse/ANN-36
> @ForceDiscriminator was created as a quick workaround to a problem.
> Yes, it solves the problem, but it creates a new problem:
> the source code which previously had only JPA annotations, now need to be annotated by a Hibernate annotation,
> causing that the the source code is now unable to use just any JPA provider.
> Major portability issue!
> Everyone who likes Open Source, hates Lock-Ins!
> My proposal: change the default to a more sane force=true, so that @ForceDiscriminator will not be needed for general JPA projects.
> (And create a @DisableDiscriminator Hibernate annotation, for those who like to brake their code).
> If changing default behavior is risky, don't fix this on older versions, but lets change this from 3.5.0-Beta2.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list