Warnings about valid Hibernate extensions to standard JPA mappings

This is a discussion on Warnings about valid Hibernate extensions to standard JPA mappings within the J2EE forums in Framework and Interface Programming category; We use Hibernate as the provider of our JPA functionality. But we also use the extra functionality that Hibernate provides above and beyond the spec. At the moment, IDEA is reporting some Persistence Model warnings related to this functionality. Is there any way to get IDEA to stop complaining when we use these extra features, but still do basic model validation? ---- The warning that IDEA complains about, but which is valid under Hibernate: - '@javax.persistence.ManyToOne' attribute cannot be used in Embeddable object This is allowed under Hibernate, just not by the JPA spec. ---- Another problem is with the ...

Go Back   Application Development Forum > Framework and Interface Programming > J2EE

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-15-2008, 01:26 AM
Shorn Tolley
Guest
 
Default Warnings about valid Hibernate extensions to standard JPA mappings

We use Hibernate as the provider of our JPA functionality.
But we also use the extra functionality that Hibernate provides above and beyond the spec.

At the moment, IDEA is reporting some Persistence Model warnings related to this functionality.

Is there any way to get IDEA to stop complaining when we use these extra features, but still do basic model validation?

----
The warning that IDEA complains about, but which is valid under Hibernate:
- '@javax.persistence.ManyToOne' attribute cannot be used in Embeddable object

This is allowed under Hibernate, just not by the JPA spec.
----
Another problem is with the following warning:
- '@org.hibernate.annotations.CollectionOfElements' attribute type should be an Embeddable

The element type of the collection property is actually declared embaddable, I'm not sure why IDEA is saying it's not.
----

The warnings both come from the inspection: Inspections\Java EE Issues\Persistence Model Errors

It would be nice if this inspection was a bit more configurable (like the "Declaration has Javadoc problems" inspection which is fully customizable).
Reply With Quote
  #2  
Old 04-15-2008, 04:19 AM
Stephen Friedrich
Guest
 
Default Re: Warnings about valid Hibernate extensions to standard JPA mappings

If you add a hibernate facet in addition to the JPA facet, then Idea understands hibernate extensions as well.
(Though there might still be some bugs there.)

Shorn Tolley wrote:
> We use Hibernate as the provider of our JPA functionality.
> But we also use the extra functionality that Hibernate provides above and beyond the spec.
>
> At the moment, IDEA is reporting some Persistence Model warnings related to this functionality.
>
> Is there any way to get IDEA to stop complaining when we use these extra features, but still do basic model validation?
>
> ----
> The warning that IDEA complains about, but which is valid under Hibernate:
> - '@javax.persistence.ManyToOne' attribute cannot be used in Embeddable object
>
> This is allowed under Hibernate, just not by the JPA spec.
> ----
> Another problem is with the following warning:
> - '@org.hibernate.annotations.CollectionOfElements' attribute type should be an Embeddable
>
> The element type of the collection property is actually declared embaddable, I'm not sure why IDEA is saying it's not.
> ----
>
> The warnings both come from the inspection: Inspections\Java EE Issues\Persistence Model Errors
>
> It would be nice if this inspection was a bit more configurable (like the "Declaration has Javadoc problems" inspection which is fully customizable).

Reply With Quote
  #3  
Old 04-15-2008, 08:36 PM
Shorn Tolley
Guest
 
Default Re: Warnings about valid Hibernate extensions to standard JPAmappings

That doesn't help.

Also, why would that be necessary given that the JPA facet has the "Default JPA provider" property (which I have set to "Hibernate")? IDEA already knows I'm using Hibernate via that property, so what would it need the Hibernate Facet for. Also note that the Hibernate facet can't be set up propertly because I don't have a hibernate.cfg.xml file to configure it with (I'm using persistence.xml).

In any case, it doesn't make a difference, the persistence model warnings still clutter up my messages window.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:02 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.