Reputation: 447
Hello Stack Overflow,
My suspicions is that this answer is 'no' but I wanted to try here first.
I am working on a project that accesses the database in 2 ways: a home grown "Database Access Object" (DAO) that modifies pre-existing tables and hibernate. Because we are trying to migrate to Hibernate and remove the use of DAO, I have a new Hibernate class for a new table. I want it to join a table that is managed by the DAO - thus does not have a Hibernate class.
I get this error " is not mapped".
Is this error because does not have an Hibernate class? Can I join this table without a Hibernate object?
Upvotes: 0
Views: 72
Reputation: 7218
You are correct you cannot use HQL to access a table which Hibernate does not know about.
You could create an Entity to represent your pre-existing tables? There is tooling which can generate these from an existing Schema. You can then continue to use your existing DAO but also access them using Hibernate (once you've registered them with your session factory).
Upvotes: 1