Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to map some Java classes using the Hibernate JPA implementation. My problem is that I can't use hardcoded Strings als column namens. You can see the error message I get in the picture below.

enter image description here

I'm using OpenJPA as my Default JPA Provider and have already tried to change it.

IntelliJ Version 14.0.3

regards,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
242 views
Welcome To Ask or Share your Answers For Others

1 Answer

You have to associate your data source (create a data source in database view first - aka your real JDBC database connection) with a persistence unit or session factory (hibernate.cfg.xml).

Follow below steps and the warnings will disappear:

  1. Open the Persistence tool window (View | Tool Windows | Persistence).
  2. Right-click the necessary module, persistence unit or session factory, and select Assign Data Sources in the context menu.
  3. In the Assign Data Sources dialog that opens, click the Data Source field and select the necessary data source. (To remove the association with the data source, select .)

See here: Associating data sources with session factories and persistence units


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...