Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 285703 - JPA Validation: Support for non-JPA specific annotations
Summary: JPA Validation: Support for non-JPA specific annotations
Status: VERIFIED INVALID
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dali.general-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-05 09:57 EDT by Ondrej Medek CLA
Modified: 2009-08-06 11:23 EDT (History)
3 users (show)

See Also:


Attachments
Simple Eclipse project with non-JPA allowed mapping. (5.87 KB, application/octet-stream)
2009-08-05 09:57 EDT, Ondrej Medek CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Medek CLA 2009-08-05 09:57:38 EDT
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.
Comment 1 Neil Hauge CLA 2009-08-05 10:46:43 EDT
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.  
Comment 2 Ondrej Medek CLA 2009-08-05 10:59:55 EDT
(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
Comment 3 Neil Hauge CLA 2009-08-05 11:11:11 EDT
(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.
Comment 4 Ondrej Medek CLA 2009-08-06 03:04:03 EDT
Dmitry Geraskov has written (at https://jira.jboss.org/jira/browse/JBIDE-4716):
"Neil Hauge right. This should be done by hibernate team."
Comment 5 Max Rydahl Andersen CLA 2009-08-06 05:34:48 EDT
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 ;)
Comment 6 Neil Hauge CLA 2009-08-06 11:13:59 EDT
(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.
Comment 7 Neil Hauge CLA 2009-08-06 11:23:08 EDT
Continued in bug 285895.