Hello everybody,
I am somehow in a dead end I don't know how to resolve it. Any help would be highly appreciated. Many thanks.
Regards
Gallus
Here is the problem:
I have a User class, with two properties login and id.
Further I have a table repository_user with two columns, id and login.
Now I want to lookup a user with a specific login and retrieve a user object.
Here is the code:
Code:
Criteria criteria = hibSession.createCriteria(User.class);
criteria.add(Expression.eq("login",login));
criteria.setMaxResults(10);
criteria.setResultTransformer(Criteria.ROOT_ENTITY);
List users = criteria.list();
Unfortunately I always get the following SQL exception:
[WARN] JDBCExceptionReporter - -SQL Error: 904, SQLState: 42000
[ERROR] JDBCExceptionReporter - -ORA-00904: "THIS"."ID": invalid identifier
I could not figure out, where the "THIS" is coming from. Would anybody have an idea what I am doing wrong?
Please also find below my configuration
Code:
<hibernate-mapping package="com.valtech.repository.persistence" >
<class
name="com.valtech.repository.persistence.User"
table="repository_user">
<id name="id" type="int" column="id" >
<generator class="sequence" >
<param name="sequence">repositoryUser_seq</param>
</generator>
</id>
<property
name="login"
column="login"
type ="java.lang.String"
update="true"
insert="true"/>
</class>
</hibernate-mapping>