I have a problem with annotation . before I create a SQL query using the <subselect> element to map to a single POJO type . <hibernate-mapping> <class name="xx.TestObject" mutable="false"> <subselect> select * from TestTable </subselect>
<synchronize table="TestTable" /> <id name="id" column="id"> <generator class="assigned" /> </id> <property name="name" column="name" /> ... but now ,I must use annotation to complete the same function.
I try to use the under code complete the function,but it can't .
@NamedNativeQuery(name = "test", query = "select * from TestTable ", resultClass = xx.TestObject.class) @Entity
how should I do?
|