com.laamella:dtotabase

A very simple in memory database

License

License

GroupId

GroupId

com.laamella
ArtifactId

ArtifactId

dtotabase
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

jar
Description

Description

com.laamella:dtotabase
A very simple in memory database
Project URL

Project URL

https://github.com/laamella-gad/dtotabase
Source Code Management

Source Code Management

https://github.com/laamella-gad/dtotabase.git

Download dtotabase

How to add to project

<!-- https://jarcasting.com/artifacts/com.laamella/dtotabase/ -->
<dependency>
    <groupId>com.laamella</groupId>
    <artifactId>dtotabase</artifactId>
    <version>1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.laamella/dtotabase/
implementation 'com.laamella:dtotabase:1.2'
// https://jarcasting.com/artifacts/com.laamella/dtotabase/
implementation ("com.laamella:dtotabase:1.2")
'com.laamella:dtotabase:jar:1.2'
<dependency org="com.laamella" name="dtotabase" rev="1.2">
  <artifact name="dtotabase" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.laamella', module='dtotabase', version='1.2')
)
libraryDependencies += "com.laamella" % "dtotabase" % "1.2"
[com.laamella/dtotabase "1.2"]

Dependencies

provided (1)

Group / Artifact Type Version
com.google.guava : guava jar 23.5-jre

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Dtotabase

The most basic in-memory database in the world.

Why?

Because for test code I needed a data structure where I could easily store DTO's (or just any object) and get them out again in various ways with the least amount of hassle.

Of course, we have maps and lists and sets and everything, but this project treats DTO's more like database rows. You can do SELECT, INSERT, DELETE and UPDATE, by using functions. Hence "DTO Database."

It's incredibly basic, anybody could make it in an hour. Well, I saved you that hour.

Maven

Here it is: Maven Central

Usage

(This is all taken from the unit tests.)

Create a table

DtoTable<Address> addressTable = new DtoTable<>()

Subclass it if you like to add more methods.

Put some data in

addressTable.insert(address1, address2)

Duplicates (objects which are equals) will be ignored

Retrieve some data

Set<Address> selected = addressTable.select(r -> r.number > 50)

This is the big advantage of Dtotabase: quickly select data in any way you like with just a simple lambda expression.

Update some data

addressTable.update(
        address -> address.number > 50,
        address -> address.number *= 2)

Delete some data

addressTable.delete(r -> r.name.contains("lane"))

Support

There may not be much activity since this project is very small, but I do intend to support it. Do report issues when you like more features or find bugs.

com.laamella

Laamella Gad

Versions

Version
1.2
1.1
1.0