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.  [ 3 posts ] 
Author Message
 Post subject: CreateSQLQuery error: No column name found for property []
PostPosted: Fri May 20, 2005 5:13 am 
Beginner
Beginner

Joined: Fri May 20, 2005 5:06 am
Posts: 28
The following line works fine and gives me all employees:
Code:
IList test = entityService.ExecuteSQLQuery("SELECT {emp.*} FROM Employees {emp}", "emp", typeof(Employee));

The next line gives me the error: No column name found for property [Active] [].
Code:
IList test = entityService.ExecuteSQLQuery("SELECT {emp}.Active AS {emp.Active} FROM Employees {emp}", "emp", typeof(Employee));

The columns are there and the mapping file is correct. Any clues what I did wrong?

UPDATE:
I tried the following:
Code:
IList test = entityService.ExecuteSQLQuery("SELECT {emp}.Active AS Test FROM Employees {emp}", "emp", typeof(Employee));

The SQL query it generated was correct, but I got the following exception: System.IndexOutOfRangeException: EmployeeId0_

Thanks, Cepheus.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 4:20 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Looks like a bug, SQL queries were not tested well enough yet, so there may be other bugs in there. Please report this one to JIRA so it doesn't get lost.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 01, 2006 4:57 am 
Newbie

Joined: Wed Aug 30, 2006 5:27 am
Posts: 1
Late Answer, but:

1. if you want to show the Employees who are active try:
IList test = entityService.ExecuteSQLQuery("SELECT {emp.*} FROM Employees {emp} where em.Active = 'true'", "emp", typeof(Employee));

2. Hibernate cant create a Pojo without all Properties?
IList test = entityService.ExecuteSQLQuery("SELECT {emp}.Active AS {emp.Active} FROM Employees {emp}", "emp", typeof(Employee));
would give you a list like:
true
false
false
true
...
->how should hibernate create pojos from this rows?


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