Hi!
I have to select some data from a database view, which has no id column.
Is there any pattern it could be applied in this case. My mapping file contains:
<id type="java.lang.String">
<generator class="assigned"/>
</id>
I have a find class with a static method for the query:
public static List findxxx(Session session,String filterVal) throws SQLException, HibernateException
{
return session.find("from package.class where filterCol='"+filterVal+"'");
}
The query built contains reference to the id column, too, so the sql statement can not be executed( i don't want to use "select table.column...." returning Object[]).
Any suggestions?
|