实际上,我找到了想要的答案:
我可以
@SqlResultSetMapping在orm.xml中使用XML 来定义的行为,因此可以使用以下定义:
@SqlResultSetMapping( name = "BookValueMapping", classes = @ConstructorResult( targetClass = BookValue.class, columns = { @ColumnResult(name = "id", type = Long.class), @ColumnResult(name = "title"), @ColumnResult(name = "version", type = Long.class), @ColumnResult(name = "authorName")}))将在XML中定义如下:
<sql-result-set-mapping name="BookValueMappingXml"> <constructor-result target-> <column name="id" /> <column name="title"/> <column name="version" /> <column name="authorName"/> </constructor-result></sql-result-set-mapping>
让我无需实体即可进行定义。



