Hi Everybody,
I am trying to map my objects to Database Views instead of tables. And when I use view name at the place of table name in my mapping file, it gives me "Missing Table" error.
Mapping File:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Group" table="Groups">
<id name="name" column="Group">
</id>
<set name="primeCommodities" inverse="true" fetch="join" cascade="all">
<key column="Group" not-null="true"/>
<one-to-many class="PrimeCommodity"/>
</set>
</class>
</hibernate-mapping>
Error Message
failed.org.hibernate.HibernateException: Missing table: Groups
java.lang.ExceptionInInitializerError
at sa.com.futureware.fastwork.fastsecure.persistance.HibernateUtil.<clinit>(HibernateUtil.java:20)
at Main.main(Main.java:22)
Caused by: org.hibernate.HibernateException: Missing table: Groups
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:953)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:299)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145)
Please help me in this regard.
Thanks and regards,
_________________ Mirza M.
|