Created
February 27, 2009 07:52
-
-
Save masanobuimai/71339 to your computer and use it in GitHub Desktop.
Grails1.1でjoin fetch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blog { | |
String title | |
String body | |
FileInfo uploadedFile | |
static constraints = { | |
title() | |
body maxSize: 4000 | |
uploadedFile nullable: true | |
} | |
static mapping = { | |
uploadedFile fetch:'join' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hibernate: | |
select | |
top ? this_.id as id0_1_, | |
this_.version as version0_1_, | |
this_.body as body0_1_, | |
this_.title as title0_1_, | |
this_.uploaded_file_id as uploaded5_0_1_, | |
fileinfo2_.id as id1_0_, | |
fileinfo2_.version as version1_0_, | |
fileinfo2_.content_type as content3_1_0_, | |
fileinfo2_.file_content_id as file4_1_0_, | |
fileinfo2_.filename as filename1_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