I got this error when I try to select on table that one of its column is foreign key:
select count(*) from cards where username = 'name';
I am doing it through java jdbc so I think something with my mapping is wrong because the same query on through MySql commandline works just fine:
<many-to-one name="users" class="table" update="false" insert="false" fetch="select">
<column name="username" length="45" not-null="true" />
</many-to-one>
The
2013-03-02 12:19:03,660 INFO [http-bio-8080-exec-5] (NullableType.java:203) - could not read column value from result set: username; Column 'username' not found.
2013-03-02 12:19:03,663 WARN [http-bio-8080-exec-5] (JDBCExceptionReporter.java:100) - SQL Error: 0, SQLState: S0022
2013-03-02 12:19:03,664 ERROR [http-bio-8080-exec-5] (JDBCExceptionReporter.java:101) - Column 'username' not found.
I fount this:
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/querysql.html#d0e13696
sections 16.1.2 and 16.1.3 probably the answer for my issue but I cant figure it out...