Questions tagged [hibernate.cfg.xml]

hibernate.cfg.xml is the name of the default config file used by Hibernate.

The file usually contains the list of Hibernate mapping files (HBM) for objects that Hibernate persists. It also contains properties that control the behavior of Hibernate.

83 questions
1
vote
2 answers

Hibernate: How to map a *.hbm.xml file in a different folder?

I have some *.hbm.xml files that are placed in the same folder at the hibernate.cfg.xml file. Now, I want to map some other *.hbm.xml files that are in a subfolder of this folder. How could I do it? Thanks! here's part of my hibernate.cfg.xml: …
tomato
  • 5,644
  • 13
  • 43
  • 48
1
vote
2 answers

Hibernate 5: Unknown entity, errorType: org.hibernate.MappingException

We have a code originally cloned from https://github.com/arun-gupta/lambda-rds-mysql. Made changes to work with PostgreSQL RDS. When we run this code on AWS it gives the following error Error Message { "errorMessage": "Unknown entity:…
Kali
  • 73
  • 1
  • 2
  • 10
1
vote
0 answers

Getting org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml

When I tried to run hibernate application file its giving issue with hibernate.cfg.xml. for parsring the file at DTD level. Can any one help me out in this. INFO: HHH000040: Configuration resource: /hibernate.cfg.xml Apr 21, 2017 4:55:09 PM…
Srinu
  • 73
  • 1
  • 5
1
vote
1 answer

Hibernate error - org.hibernate.MappingException: Unknown entity:

guys ! i have very strange problem with hibernate 5. I receive Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.rosko.Merchandiser When i remove…
1
vote
3 answers

why we need to define dilect,when we have already defined driver in configuration file in hibernate

In many of document I found we have to define dialect in hibernate.cfg.xml to tell hibernate what language we are going to use in or hibernate.On the basis of this hibernate generates respective sql.
user4768611
1
vote
1 answer

Hibernate ConfigurationException: Could not locate cfg.xml resource [hibernate.cfg.xml] IntelliJ

I have a problem with my hibernate.cfg.xml in IntelliJ IDE. Here is my hibernate config file:
tschens
  • 39
  • 2
  • 7
1
vote
2 answers

How can I create a Hibernate session without hiberante.cfg.xml file?

This is my first time using Hiberante. I am trying to create a Hibernate session within my application using the following: Session session = HiberanteUtil.getSessionFactory().openSession(); It gives me this…
java123999
  • 6,974
  • 36
  • 77
  • 121
1
vote
1 answer

Hibernate specified cfg.xml file [/src/main/resources/hibernate.cfg.xml] does not exist

I have a Mave + Hibernate + Eclipse project. My hibernate.cfg.xml in in /src/main/resources (as it should be) This is my tree My tree The HibernateUtil class start the session (I've also tried to force cfg.xml as you can see in the commented part…
MarioC
  • 2,934
  • 15
  • 59
  • 111
1
vote
1 answer

web application structure hierarcy problem

Below an illustration of my project hierarchy (source: yfrog.com) When i try to connect my file_name.java file to hibernate i'm getting these errors Exception in thread "main" org.hibernate.HibernateException: Could not instantiate cache…
Chetan
  • 1,590
  • 3
  • 19
  • 34
1
vote
2 answers

Why can't Hibernate find /hibernate.cfg.xml?

I am trying to learn Hibernate + Maven. I am trying to connect to a PostgreSQL database, but I am getting the following error: Initial SessionFactory creation failed.org.hibernate.HibernateException: hibernate.cfg.xml not found hibernate.cfg.xml…
1
vote
1 answer

How to externalize Hibernate 3.6 configuration

I have an app which uses Hibernate 3.6.3 as the ORM. I created the hibernate.cfg.xml configuration file and added it to the build path. This works fine in my development environment. Now I need to create a jar for the production server with a…
orwe
  • 233
  • 1
  • 3
  • 10
1
vote
0 answers

Change hibernate.cfg.xml runtime - second part

I'm trying to use a mixed form for the definition of the SessionFactory, because I want to allow the user using my webapp (SpringMVC +hibernate), the first interaction, define the credentials to access the database. I defined the following…
user2983066
  • 80
  • 1
  • 10
1
vote
5 answers

Hibernate configuration - session factory scanning?

We have this hibernate.cfg.xml file. Is there a way to tell Hibernate to just scan a directory instead of having to add an entry here for each class?
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
1
vote
2 answers

how to fetch data of remote side database in hibernate

I developing a application of reporting tool. I have to connect multiple remote side database with their credentials and fetching the database value. How can I do this? This is my hibernate configuration file
Vikki
  • 279
  • 1
  • 4
  • 17
1
vote
2 answers

Hibernate, Could not parse configuration

I am new to Hibernate .... i tried this code but i got Could not parse configuration: NewFile.cfg.xml (name of .cfg.xml file)