-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: facing the error : Class is not mapped
PostPosted: Sat Jan 14, 2006 3:47 am 
Newbie

Joined: Sat Dec 24, 2005 8:39 am
Posts: 15
Hi,

I am facing the error that says a given class (which is mentioned in the hbm file) is not mapped.

My mapping and log is given below. Any help on this please?

Thanks
Ahmad

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0

Mapping documents:
<hibernate-mapping>
<class name="com.ge.nbc.ops.broadcast.bus.affiliate.domain.NetworkAssociatedLink" table="NETWORK_ASSOCIATED_LINK">
<id name="networkAssociatedLinkID" type="long">
<column name="NWRK_ASSOCIATED_LINK_ID" precision="15" scale="0" />
<generator class="sequence">
<param name="sequence">NWRK_ASSOCIATED_LINK_SEQ</param>
</generator>
</id>
<property name="networkAssociatedLinkText" type="string">
<column name="NWRK_ASSOCIATED_LINK_TEXT" length="100" not-null="true" />
</property>
<property name="lastUpdatedDateTime" type="date">
<column name="LAST_UPDATE_DATE_TIME" length="7" />
</property>
<property name="lastUpdatedUserID" type="long">
<column name="LAST_UPDATE_USER_ID" />
</property>
<property name="createdDate" type="date">
<column name="CREATE_DATE_TIME" length="7" />
</property>
<property name="deletedFlag" type="yes_no">
<column name="DELETED_FLAG" length="1" />
</property>
<many-to-one name="networkOfLink" class="com.ge.nbc.ops.tv.bus.network.domain.TVNetwork">
<column name="TV_NETWORK_ID" />
</many-to-one>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
2006-01-14 13:05:33,585 DEBUG [com.ge.nbc.ops.broadcast.bus.affiliate.dao.NetworkAssociatedLinkDAO] Inside try block of NetworkAssociatedLinkDAO: selectNetworkAssociatedLinks()
2006-01-14 13:05:41,850 DEBUG [com.ge.nbc.ops.broadcast.bus.affiliate.dao.NetworkAssociatedLinkDAO] Entered NetworkAssociatedLinkDAO: selectNetworkAssociatedLinks()
2006-01-14 13:05:42,319 DEBUG [com.ge.nbc.ops.broadcast.bus.affiliate.dao.NetworkAssociatedLinkDAO] Inside try block of NetworkAssociatedLinkDAO: selectNetworkAssociatedLinks()
2006-01-14 13:05:42,678 DEBUG [org.hibernate.impl.SessionImpl] find: from NetworkAssociatedLink a
2006-01-14 13:05:42,678 DEBUG [org.hibernate.engine.QueryParameters] named parameters: {}
2006-01-14 13:05:44,491 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] parse() - HQL: from NetworkAssociatedLink a
2006-01-14 13:05:44,725 DEBUG [org.hibernate.hql.ast.AST] --- HQL AST ---
\-[QUERY] 'query'
\-[SELECT_FROM] 'SELECT_FROM'
\-[FROM] 'from'
\-[RANGE] 'RANGE'
+-[IDENT] 'NetworkAssociatedLink'
\-[ALIAS] 'a'

2006-01-14 13:05:44,725 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
2006-01-14 13:05:45,725 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] query() << begin, level = 1
2006-01-14 13:05:46,241 ERROR [org.hibernate.hql.PARSER] *** ERROR: NetworkAssociatedLink is not mapped.
2006-01-14 13:05:46,241 DEBUG [org.hibernate.hql.ast.ErrorCounter] NetworkAssociatedLink is not mapped.
NetworkAssociatedLink is not mapped.
at org.hibernate.hql.ast.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:85)
at org.hibernate.hql.ast.FromElementFactory.addFromElement(FromElementFactory.java:77)
at org.hibernate.hql.ast.FromClause.addFromElement(FromClause.java:67)



Name and version of the database you are using: Oracle 9i


Top
 Profile  
 
 Post subject: Re: facing the error : Class is not mapped
PostPosted: Sat Jan 14, 2006 3:50 am 
Newbie

Joined: Sat Dec 24, 2005 8:39 am
Posts: 15
Hi,

I am facing the error that says a given class (which is mentioned in the hbm file) is not mapped.

My mapping and log is given below. Any help on this please?

The mapping files are in my EJB jar and my class files are present in the appropriate domain package in EJB jar

Thanks
Ahmad

Hibernate version:3.0

Mapping documents:
<hibernate-mapping>
<class name="com.ge.nbc.ops.broadcast.bus.affiliate.domain.NetworkAssociatedLink" table="NETWORK_ASSOCIATED_LINK">
<id name="networkAssociatedLinkID" type="long">
<column name="NWRK_ASSOCIATED_LINK_ID" precision="15" scale="0" />
<generator class="sequence">
<param name="sequence">NWRK_ASSOCIATED_LINK_SEQ</param>
</generator>
</id>
<property name="networkAssociatedLinkText" type="string">
<column name="NWRK_ASSOCIATED_LINK_TEXT" length="100" not-null="true" />
</property>
<property name="lastUpdatedDateTime" type="date">
<column name="LAST_UPDATE_DATE_TIME" length="7" />
</property>
<property name="lastUpdatedUserID" type="long">
<column name="LAST_UPDATE_USER_ID" />
</property>
<property name="createdDate" type="date">
<column name="CREATE_DATE_TIME" length="7" />
</property>
<property name="deletedFlag" type="yes_no">
<column name="DELETED_FLAG" length="1" />
</property>
<many-to-one name="networkOfLink" class="com.ge.nbc.ops.tv.bus.network.domain.TVNetwork">
<column name="TV_NETWORK_ID" />
</many-to-one>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
2006-01-14 13:05:33,585 DEBUG [com.ge.nbc.ops.broadcast.bus.affiliate.dao.NetworkAssociatedLinkDAO] Inside try block of NetworkAssociatedLinkDAO: selectNetworkAssociatedLinks()
2006-01-14 13:05:41,850 DEBUG [com.ge.nbc.ops.broadcast.bus.affiliate.dao.NetworkAssociatedLinkDAO] Entered NetworkAssociatedLinkDAO: selectNetworkAssociatedLinks()
2006-01-14 13:05:42,319 DEBUG [com.ge.nbc.ops.broadcast.bus.affiliate.dao.NetworkAssociatedLinkDAO] Inside try block of NetworkAssociatedLinkDAO: selectNetworkAssociatedLinks()
2006-01-14 13:05:42,678 DEBUG [org.hibernate.impl.SessionImpl] find: from NetworkAssociatedLink a
2006-01-14 13:05:42,678 DEBUG [org.hibernate.engine.QueryParameters] named parameters: {}
2006-01-14 13:05:44,491 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] parse() - HQL: from NetworkAssociatedLink a
2006-01-14 13:05:44,725 DEBUG [org.hibernate.hql.ast.AST] --- HQL AST ---
\-[QUERY] 'query'
\-[SELECT_FROM] 'SELECT_FROM'
\-[FROM] 'from'
\-[RANGE] 'RANGE'
+-[IDENT] 'NetworkAssociatedLink'
\-[ALIAS] 'a'

2006-01-14 13:05:44,725 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
2006-01-14 13:05:45,725 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] query() << begin, level = 1
2006-01-14 13:05:46,241 ERROR [org.hibernate.hql.PARSER] *** ERROR: NetworkAssociatedLink is not mapped.
2006-01-14 13:05:46,241 DEBUG [org.hibernate.hql.ast.ErrorCounter] NetworkAssociatedLink is not mapped.
NetworkAssociatedLink is not mapped.
at org.hibernate.hql.ast.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:85)
at org.hibernate.hql.ast.FromElementFactory.addFromElement(FromElementFactory.java:77)
at org.hibernate.hql.ast.FromClause.addFromElement(FromClause.java:67)



Name and version of the database you are using: Oracle 9i[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 5:15 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
Try specifying the full class name in your HQL.


Top
 Profile  
 
 Post subject: Got the fix
PostPosted: Sat Jan 14, 2006 7:51 am 
Newbie

Joined: Sat Dec 24, 2005 8:39 am
Posts: 15
Thanks Raja,

I could locate the root cause of the problem. The property file was named different which was having the mapping names. There was version conflict in the property file which led to hibernat not finding that particular file, hence it could not locate individual classes.


Regards
Ahmad


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.