<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
<sql-result-set-mapping name="nativesql_mapping_example">
<entity-result entity-class="kr.pe.kwonnam.Book">
<field-result name="id" column="bk.id" />
<field-result name="title" column="bk.title" />
<field-result name="price" column="bk.price" />
<!-- Author writer, Long writerId 매핑이 함께 존재할경우 -->
<field-result name="writerId" column="bk.writer_id" />
<field-result name="writer" column="bk.writer_id" />
</entity-result>
<entity-result entity-class="kr.pe.kwonnam.Author">
<field-result name="id" column="at.id" />
<field-result name="name" column="at.name" />
</entity-result>
</sql-result-set-mapping>
</entity-mappings>