Hibernate 3 allows SQL queries (I think - I haven't actually tried it yet). There's a whole chapter (16) in the manual on it.

Dave wrote:

I am not sure if Hibernate support this. Right now em.createNativeQuery() is not implemented.

*/David Haynes <[EMAIL PROTECTED]>/* wrote:

    Most relational databases have the ability to return a sub-set of the
    entire result set.
    SQL allows you to say something like 'WHERE rownum > skip AND
    rownum <=
    (skip+n)'.
    Some databases use an alternate syntax to achieve the same result.
    (e.g. MySQL uses 'OFFSET skip LIMIT n')

    As Mike Kienenberger pointed out earlier today in his reply, the
    dataTable tag supports this via the parameters 'first=skip rows=n'
    and
    those values (skip and n) can be made available to your backing bean.
    So, you can code the SQL query (in JDBC or Hibernate or what-ever) to
    honour the skip and n values.

    -david-

    Dave wrote:

    >
    > Does JDBC execute query return the whole set of records in
    memory? do
    > you mean data model in JDBC library? Thanks!
    > */Werner Punz /* wrote:
    >
    > Dave wrote:
    > ; > For a large database table that has millions of records(rows),
    > how is
    > > the memory managed from backend to ? all the millions of
    > > records are in memory? That would crash the system. Is the
    > collection(
    > > returned from database layer) actually not filled with data
    > until they
    > > are requested ? Thanks. Dave
    > >
    > implementing a custom datamodel might be your friend in this case...
    > unless you use plain jdbc, afair there was a jdbc datamodel in the
    > core classes.
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Tired of spam? Yahoo! Mail has the best spam protection around
    > http://mail.yahoo.com
    >


------------------------------------------------------------------------
Click here to donate to the Hurricane Katrina relief effort. <http://store.yahoo.com/redcross-donate3/>



Reply via email to