Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested cursor #3388

Merged
merged 7 commits into from
Jan 26, 2025
Merged

Conversation

harawata
Copy link
Member

@harawata harawata commented Jan 5, 2025

By specifying "CURSOR" to jdbcType attribute.

<resultMap id="blogResult" type="Blog">
  <id property="id" column="id" />
  <result property="title" column="title" />
  <collection property="posts" column="posts" jdbcType="CURSOR">
    <id property="id" column="id" />
    <result property="subject" column="subject" />
    <result property="body" column="body" />
  </collection>
</resultMap>

<select id="selectBlog" resultMap="blogResult">
  select b.id, b.name, cursor(
    select p.id, p.subject, p.body from post p where p.blog_id = b.id
  ) posts from blog b
</select>

See the attached test cases for more examples.

Should fix #566

By specifying a special name NESTED_CURSOR to `resultSet` attribute,

Should fix mybatis#566
@harawata harawata marked this pull request as ready for review January 5, 2025 20:35
@coveralls
Copy link

coveralls commented Jan 5, 2025

Coverage Status

coverage: 87.22% (-0.1%) from 87.326%
when pulling 03dc3e4 on harawata:gh/566-oracle-nested-cursor
into d4af490 on mybatis:master.

@harawata harawata force-pushed the gh/566-oracle-nested-cursor branch from 53933ac to 1df5aaf Compare January 7, 2025 19:49
@harawata harawata merged commit 123c42e into mybatis:master Jan 26, 2025
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support of nested cursors
2 participants