0

Just example of xml file will be enough)

OR

Can Hibernate load needed entity(all records) at the starting of application and store it in memory for quick access?

2
  • What did you try? What particular problem did you face? Commented Oct 23, 2010 at 20:45
  • I tried to find out in google how to mark this special table, and didn`t find. I just wonna know how to tell Hibernate that is HEAP. Commented Oct 23, 2010 at 21:12

1 Answer 1

1

(...) I just wanna know how to tell Hibernate that is HEAP.

This part is still unclear. Unless you want Hibernate to generate this table (which is AFAIK not possible), you shouldn't have to tell Hibernate that the table is a HEAP table. Just map your entity, create and load the table before to start your application and see what happens.

Can Hibernate load needed entity (all records) at the starting of application and store it in memory for quick access?

You could use second level caching (with query caching depending on how you access the entities) to achieve something approaching. Caching entities in the second level cache won't load them at startup, you ill have to write some custom code for that, but you will avoid database hits. This works particularly well with read-only entities (like reference data such as countries, currencies, etc).

References

Resources

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.