Re: Generics

From: Cris Daniluk (cris.danilu..mail.com)
Date: Mon Feb 27 2006 - 09:57:23 EST

  • Next message: emre.yilma..r.net: "Re:Re:Re: Prefetched Query"

    > You meant SelectQuery(Class, Expression) vs. SelectQuery(String,
    > Expression), right?

    Sorry, yeah...

    > I've never actually understood why the second was in there. I like
    > the compiler checking my spelling, and that only happens in the
    > first. And you can always use Class.forName() if you really want to
    > use a String. There's probably a reason it's necessary that I'm not
    > aware of.

    It's a handy feature. I use it from time to time for
    configuration-driven queries. It's also internally used extensively.
    There are other times where Class.forName isn't a viable option. A
    named query has its root defined in the map. Not an easy way to expose
    that to the compiler. In fact, it's not possible at all for named
    queries created at runtime, after the type erasure...

    Cris



    This archive was generated by hypermail 2.0.0 : Mon Feb 27 2006 - 09:57:25 EST