Hibernate : efficient way to load an object.

S

shaji.cc

Hi,
I am using hibernate 3.0 and would like to know about the comparative
performance of its features.

Assume you have a table person and class Person with primary key
person_id.
Now you can use session.load(Person.class, id) to obtain an instance.
You can also use session.createQuery().*
You can also use session.createCreateCriteria.add(Restrictions).*

Which one of these is faster and efficient in terms of performance.
And, if the primary key is a combination of two columns (composite
keys)
how can one use session.load()?

-Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top