-->
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: Mapping 2 classes to one table.
PostPosted: Sat Apr 22, 2006 3:21 pm 
Beginner
Beginner

Joined: Wed Jun 09, 2004 8:10 am
Posts: 28
Hibernate 3.2.0.rc1

How can I map 2 classes (light-weight and heavy-weight) to the same table (I map using annotations). Now I've got strange errors like:

Code:
Caused by: java.sql.SQLException: ORA-00904: "SHORTSYSTE0_"."DTYPE": invalid identifier

   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
   at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
   at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
   at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
   at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:880)
   at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2516)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2850)
   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
   at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:537)
   at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
   at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
   at org.hibernate.loader.Loader.doQuery(Loader.java:662)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
   at org.hibernate.loader.Loader.doList(Loader.java:2145)
   ... 19 more


When I remove one mapping everything works fine. Help please!

I select it using:

Code:
result = session.createQuery("from " + entityClass.getName()).list();


Top
 Profile  
 
 Post subject: +
PostPosted: Sat Apr 22, 2006 3:47 pm 
Beginner
Beginner

Joined: Wed Jun 09, 2004 8:10 am
Posts: 28
entities classes are:

Code:
class LightWeight implements Serializable {
...
}

class HeavyWeight extends LightWeight {
...
}


Is it okay?


Top
 Profile  
 
 Post subject: Re: Mapping 2 classes to one table.
PostPosted: Sun Apr 23, 2006 11:53 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
PavelKrupets wrote:
Hibernate 3.2.0.rc1

How can I map 2 classes (light-weight and heavy-weight) to the same table (I map using annotations). Now I've got strange errors like:

Code:
Caused by: java.sql.SQLException: ORA-00904: "SHORTSYSTE0_"."DTYPE": invalid identifier

...
entityClass.getName()).list();


you have an error mapping your id in the mapping file.
check your hbm config.

_________________
Please don't forget to give credit, if my posting helped to solve your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 23, 2006 5:27 pm 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
I agree with axismundi, you have a configuration with your mapping or annotations. Turn on SQL logging to see what Hibernate is generating and see if it looks right. This will help you narrow down where your mapping issue is.

Ryan-

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember to rate!


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.