hi,
I would like to get the Column Names out of a native SQL Query.
The query looks like that for example: String sqlCMD = "SELECT SQL_CALC_FOUND_ROWS c.diagramobject_id, c.objecttypename, c.name " + "FROM diagramobject c " + "LEFT OUTER JOIN diagramobject_property d ON (d.diagramobject_id = c.diagramobject_id) " + "WHERE c.organisation_id="+organization_id+" " + "AND lower(c.name) LIKE lower('"+search+"') " + "AND c.deleted NOT LIKE 'true' "; "AND lower(d.value) LIKE lower('"+search+"') ";
The Result: List<Object[]> diagramObjectList = query.list();
The Problem is the resulting Object: diagramObjectList => does only contain the value's like [1,blabla,anotherBla] what I would like to have is: [diagramobject:1,objecttypename:blabla,name:anotherBla]
running the query with c.diagramobject_id as diagramobject_id => does not change anything.
What can be done in usual JDBC is to get the MetaData of the Result-Set to get the column names. But there is no way of doing that through Hibernate?
What can be done to solve this? I don't know the field names of the SQL Query as they may vary.
thanks, sebastian
_________________ http://www.laszlo-forum.de
http://www.webbase-design.de
|