-->
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: Mapped table name is not being used
PostPosted: Wed Sep 17, 2003 4:34 pm 
Newbie

Joined: Wed Sep 17, 2003 4:20 pm
Posts: 3
I'm having a problem with my mappings. The table I specify is not being used. I checked the SQL being sent to the console and it appears to be using the unqualified class name. Since both the table name and class name are the same I tried changing the table name with no effect. I also tried changing the class name and the table name in the SQL changed to the new unqualified class name. I also tried printing out the table that the class is mapped to in the Configuration object and the correct table name was returned. Why is my mapping not working?

My very simple mapping:
Code:
        <class name="com.***.User" table="user" >
                <id name="id" column="id" type="integer">
                        <generator class="identity"/>
                </id>

                <property name="username" type="string"/>
                <property name="password" type="string"/>

        </class>


SQL output from the console:
Code:
Hibernate: select user0_.id as id, user0_.user_type as user_type, user0_.username as username, user0_.password as password from USER user0_


Top
 Profile  
 
 Post subject: Re: Mapped table name is not being used
PostPosted: Wed Sep 17, 2003 4:57 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You're not executing the request associated with your mapping file. Your mapping has 2 properties and you request has the additional user_type column.
Check for the really loaded mapping file.


Top
 Profile  
 
 Post subject: Re: Mapped table name is not being used
PostPosted: Wed Sep 17, 2003 5:15 pm 
Newbie

Joined: Wed Sep 17, 2003 4:20 pm
Posts: 3
The user _type column is the discriminator. I simply removed it from the mapping and forgot to get the updated output. I tried this with multiple different mappings, all of which actually got loaded, and all of which failed.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2003 2:57 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Is USER a reserved keyword of your database ?

Can you show :
- your mapping file (including a simple mapping to com.mydomain.User class on T_USER table)
- the SQL output related to a session.load(com.mydomain.User.class, userId)
- your hibernate configuration file (including your Database Dialect)


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.