Community
Participate
Working Groups
Created attachment 143505 [details] Simple Eclipse project with non-JPA allowed mapping. Build ID: Build id: 20090621-0832 Steps To Reproduce: I have an Eclipse project with JPA with associations inside a composite identifier. It is not allowed by JPA spec., but Hibernate allows it. It works fine, I can deploy my project, just Eclipse (JPA validator) shows error: Attribute "channel" has invalid mapping type in this context. More information: The problematic may look like: @Embeddable public class UserRolesPK implements Serializable { @Column(nullable=false, length=15) private String role; @ManyToOne @JoinColumn private User user; } I am also attaching a simple project showing this error.
This type of functionality is achieved by installing a JPA Platform plugin from a given JPA Vendor. In this case you would want to use a Hibernate platform when configuring your Dali project. You will need to look at Hibernate Tools to get the appropriate plugin.
(In reply to comment #1) > This type of functionality is achieved by installing a JPA Platform plugin from > a given JPA Vendor. In this case you would want to use a Hibernate platform > when configuring your Dali project. You will need to look at Hibernate Tools > to get the appropriate plugin. > Well, the folks from JBoss Tools told me to open this bug. I have written to them to reopen this bug if they need some changes in Dali to provide this functionality. See https://jira.jboss.org/jira/browse/JBIDE-4716
(In reply to comment #2) > > Well, the folks from JBoss Tools told me to open this bug. I have written to > them to reopen this bug if they need some changes in Dali to provide this > functionality. See https://jira.jboss.org/jira/browse/JBIDE-4716 > That sounds fine. They should definitely be able to add support for non-spec annotations and customize validation as necessary. If there are any issues with doing so it would most likely be a bug.
Dmitry Geraskov has written (at https://jira.jboss.org/jira/browse/JBIDE-4716): "Neil Hauge right. This should be done by hibernate team."
Sorry for not being clear on what should be reported to Dali. I understand this specific validation is just Dali being strict and Hibernate being flexible. What I wanted to get raised towards Dali is that we should consider having a a configurable warning/error level for these validations. i.e. like JDT have for their validation - error/warning/info. As far as I can see Dali Generic platform have no option for such and I think it should have since all JPA implementations will have more flexible rules than the JPA spec. That would allow users to still use Dali/Generic platform and get all the other tooling even when using a platform that is more flexible. Today the only option is to disable Dali completely in which is sad ;)
(In reply to comment #5) I totally agree with the need for this functionality, and was pretty sure that I had entered an Enhancement for this, but I can't seem to find it. I'll go ahead and create a new Enhancement specifically for this feature. It is very high on our priority list of things to do. The only workaround right now is to live with the error, or disable all Dali validation, which is indeed unfortunate.
Continued in bug 285895.