On Aug 30, 12:09 pm, "Mark Mandel" <
mark.man...@gmail.com> wrote:
> I prefer TQL, as then you don't get a bleed between the object model
> and the relational model.
>
> But hey, that's just my opinion ;o)
>
I really wish Transfer provided this by default so you could make
efficient TQL queries. Currently there's no way to make a proper TQL
query based on the composite object without doing a join, which
transfer turns into a join, which means your database is potentially
joining huge record sets when 'select * from table where userId = ?'
would have been sufficient.
Can't say I really see any bleed argument since it's effectively the
same as object.getUser().getId(), only it doesn't force the lazy load!
I mean Transfer has the knowledge about the composition, it's just not
available. :/ Hmm...
I guess I'm okay with the <property/> trick. Not the most efficient,
but it works. What I think fixes the bigger join TQL issue is
providing proper native syntax to be smarter about this.
What about adding composition id access instead:
select * from SearchOptions s where
s.user.id = ?
Then you can do a proper query against the table without needing the
JOIN, but you also don't have to expose the getWhateverId() by
default.
What do you think? :)
- Elliott