Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java in memory SQL Table like data structure

Several times I have wanted a data structure that is similar to a SQL Table where you can select on various fields and multiple fields. Similar to an in memory SQL implementation except that I don't want to store that many objects in the data structure.

I also require the object to be serializable through standard Java means.

I have done this before with multiple hash tables or custom hash keys but it ended up being a lot of code and very specific the problem.

I have also used Groovy with its closure ability and gpath to help but I don't always have it available (different projects).

EDIT: I think my problem is more of an object traversal/selection problem Here are some interesting projects:

  • http://josql.sourceforge.net/
  • http://homepages.mcs.vuw.ac.nz/~djp/JQL/
  • http://today.java.net/pub/a/today/2006/08/03/java-object-querying-using-jxpath.html
  • http://code.google.com/p/lambdaj/ (I used this in the past and it was.... slow...)
  • http://jedi.codehaus.org/ Jedi

However the downside to most of these projects is that they are much slower than accessing the objects directly (non reflection getter/setter) and definitely slower than an index (hash).

like image 266
Adam Gent Avatar asked Dec 29 '10 23:12

Adam Gent


1 Answers

JavaDB and HSQLDB, among others, have fully in-memory databases.

like image 148
RobertB Avatar answered Sep 16 '22 18:09

RobertB