aspose file tools*
The moose likes Object Relational Mapping and the fly likes org.hibernate.hql.ast.QuerySyntaxException: INFORMATION_SCHEMA.SYSTEM_ALIASES is not mapped. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "org.hibernate.hql.ast.QuerySyntaxException: INFORMATION_SCHEMA.SYSTEM_ALIASES is not mapped." Watch "org.hibernate.hql.ast.QuerySyntaxException: INFORMATION_SCHEMA.SYSTEM_ALIASES is not mapped." New topic
Author

org.hibernate.hql.ast.QuerySyntaxException: INFORMATION_SCHEMA.SYSTEM_ALIASES is not mapped.

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
when I executed the a hibernate application to test, i got the above exception.

the code is:


cfg filr



pojo:



here in my DB, we don.t have the id column, that's why we are getting the problem? in hibernate we must needed the id attribute, but in our table it doesn't, The error is


How to avoid this problem?


Thanks,
Kumar
Reehan Lalkhanwar
Ranch Hand

Joined: Jun 16, 2007
Posts: 106
H.E.M. (Hibernate Entity Manager) prefixes the schema name of accessed database tables to that of the connecting user. For example, if my database account username is MICKEYMOUSE, and I connect a database and then all tables that I try to access will be accessed as MICKEYMOUSE.*.
So try removing the "INFORMATION_SCHEMA" schema name from the query.


Thank you,
Reehan
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
I tried in that by removing schema too, but I get the same exception

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Are you connecting using a user that can see this table? Are they in the same schema, or has the table been made available via another mechanism (e.g. synonyms)?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Paul Sturrock wrote:Are you connecting using a user that can see this table? Are they in the same schema, or has the table been made available via another mechanism (e.g. synonyms)?


I'm using HSQL Database Engine and these tables are already predefined with JBOSS Dev studio. They are in the same schema too.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


They are in the same schema too.

So when you log in to the database using a normal SQL client and the user details hibenrate is using to connect you can see this object?
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Paul Sturrock wrote:

They are in the same schema too.

So when you log in to the database using a normal SQL client and the user details hibenrate is using to connect you can see this object?


Yes, Before I start using hibernate, I used JDBC code to test and I got the results too
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Sorry - I'm a bit slow today.

Objects in HQL are case sensitive. You've mapped SystemAliases, not SYSTEM_ALIASES.
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Paul Sturrock wrote:Sorry - I'm a bit slow today.

Objects in HQL are case sensitive. You've mapped SystemAliases, not SYSTEM_ALIASES.


Hey Paul, I got idea and changed to "from SystemAliases"


I didn't find exception but I didn't find the results, in DB there are.
and the query is look like I printed from console.



Here I got a doubt, actually there is no id in the table (SYSTEM_ALIASES), but I put the id tag in the hbm file as it is recommended. Then generally it supposed to throw an SQL error as Im trying to fetch id form the table. why it is not throwing error?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Here I got a doubt, actually there is no id in the table (SYSTEM_ALIASES), but I put the id tag in the hbm file as it is recommended.


Not just recommended, its mandatory (unless you are using a composite-id).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.hibernate.hql.ast.QuerySyntaxException: INFORMATION_SCHEMA.SYSTEM_ALIASES is not mapped.