Sorry maybe what I request has already existed but I really couldn't find it in
documentation. So raise the question here.
ORM tools like Hibernate normally provide configuration to allow printing trace
logs of each underline JDBC SQL executed behind the high-level API calls.
I wonder if GAE provide the similar, printing trace logs of each data store
access, at lease on development server environment.
This is very useful in finding if the application's entity model design is good
in terms of performance.
By the way, another question regarding on JDO's lazy-loading behavior. Say if I
have an Owned One-to-One relationship, and I am trying to get the One side
object's Key (not the other properties), will this cause a data store query at
once?
e.g. I have
Class Brand {
@Persistent
DSFile logo;
}
Class DSFile {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
private String pkId;
@Persistent
private Blob content;
@Persistent
private String fileName;
}
and when I access:
// will fetching of entire DSFile object?
brand.getLogo().getPkId()
// or fetching of entire DSFile object(and the Blob content) only happens when
accessing non-primary key field?
brand.getLogo().getFileName()
Here fetching of Blob field could be expensive (right?) so I want to avoid it.
Similiar model implemented on Hibernate and RDBMS will not cause 2nd DB query
when getPkId(), because the relationship is implemented as a forign column
(logoFileId) which is in Brand Table itself.
Please comment?
Thanks
Original issue reported on code.google.com by yongli2...@gmail.com on 31 Oct 2010 at 12:52
Original issue reported on code.google.com by
yongli2...@gmail.com
on 31 Oct 2010 at 12:52