| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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). |
|
#2
| |||
| |||
| 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). |
|
#3
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.