Hibernate - having problems generating persistence mappings

Answered

Hey.
I'm using hibernate and using the annotations way of defining the entities and not using xml.

When I'm writing a query, intellij complains about the entities, saying:

ClassName is not mapped


I found this article: Generating Persistence Mappings and it states that there are three ways to do so:
  • Hibernate mappings
  • Entity beans
  • Database schema

but when I right click the module, go hover the Generate Persistence Mapping item I get a submenu with only one choice: Database schma.

Am I missing something with the configuration of the hibernate support maybe?
Thanks.

1 comment
Comment actions Permalink

Hello Nitzan,
There should be persistence xml configuration file in META-INF directory inside your project to have an option to use Hibernate mapping. This file should be also added in JPA facet. For the resolve an mapping to work, this file should have xml mapping file specified.

0

Please sign in to leave a comment.