Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java ORM for a read only DB

I know hibernate but I wonder if there would be a lighter ORM engine for a read only database. I mean, I don't need some transactional queries or to update some records. On the other side, I need to handle some large list of records:

List<MyRecord> list= object.getMyRecords(); // list.size() > 1E7

Does such engine exist ? Many thanks,

Pierre

like image 735
Pierre Avatar asked Aug 16 '10 08:08

Pierre


People also ask

What ORM to use in Java?

Hibernate is a Java persistence framework that simplifies the development of Java application to interact with the database. It is an open source, widely used, lightweight, ORM tool.

Is hibernate the best ORM?

If your project does not have an intensive report generation and/or you're comfortable with ORM mapping, Hibernate is your best choice. Otherwise, I strongly recommend checking out for alternatives. You may find wonderful things outside the mainstream. by Jonatas de Moraes Junior @honatas.

Is Hibernate and ORM same?

Hibernate is an open source object relational mapping (ORM) tool that provides a framework to map object-oriented domain models to relational databases for web applications.

Why is ORM preferred over JDBC?

It maps Java classes to the database variables via XML. While working with domain-driven applications and in the case of complex object relationships, ORM is mostly preferred but when the application is simple enough then it is better to use JDBC.


1 Answers

You can check out JIRM (yes, that is a shameless plug) which is an ORM focused on using immutable objects.

It sits right on top of Spring JDBC so, if you're using Spring, it's very low risk to try it.

It also has really nice SQL placeholder templates that do not require Spring.

Another project you should checkout is jOOQ.

like image 63
Adam Gent Avatar answered Oct 04 '22 04:10

Adam Gent