Skip to content

Instantly share code, notes, and snippets.

@masanobuimai
Created February 27, 2009 07:56
Show Gist options
  • Save masanobuimai/71341 to your computer and use it in GitHub Desktop.
Save masanobuimai/71341 to your computer and use it in GitHub Desktop.
Grails1.0.4でjoin fetchする
class BlogController {
def scaffold = true
def list = {
[blogInstanceList: Blog.findAll([fetch: [uploadedFile: 'eager']])]
}
:
Hibernate:
select
this_.id as id2_1_,
this_.version as version2_1_,
this_.body as body2_1_,
this_.title as title2_1_,
this_.uploaded_file_id as uploaded5_2_1_,
fileinfo2_.id as id0_0_,
fileinfo2_.version as version0_0_,
fileinfo2_.content_type as content3_0_0_,
fileinfo2_.file_content_id as file4_0_0_,
fileinfo2_.filename as filename0_0_
from
blog this_
left outer join
file_info fileinfo2_
on this_.uploaded_file_id=fileinfo2_.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment