-->
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.  [ 2 posts ] 
Author Message
 Post subject: Schema Name not appearing in query
PostPosted: Tue Apr 21, 2015 5:32 am 
Newbie

Joined: Tue Apr 21, 2015 5:27 am
Posts: 1
I hope someone can answer this as i have been struggling with it for some time now.

Why does the schema name not get prepended on the increment select query? (Hibernate version 4.0)

Mapping:
Code:
    <class name="DealUseHDO" table="DEAL_USE" schema="PROPOSAL">

        <id name="id" column="DEAL_USE_ID">
            <generator class="increment"/>
        </id>


Query executed:
Code:
select max(DEAL_USE_ID) from DEAL_USE


Error:
Code:
java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist


Top
 Profile  
 
 Post subject: Re: Schema Name not appearing in query
PostPosted: Tue Apr 28, 2015 5:59 pm 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
Looks like you are writing a native query (Table name DEAL_USE vs entity name DealUseHDO)

try
Code:
session.createQuery("select max(du.id) from DealUseHDO du")


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.