Storm - a fast, easy to use, no-bullshit opinionated Java ORM inspired by Doctrine

Related tags

ORM storm
Overview

Storm is a fast, easy to use, no-bullshit opinionated Java ORM inspired by Doctrine. The main goal of this project is to allow future-mats to easily implement Sql-based storage and relation solutions in my projects and easily prototype concepts, without harming production usability.

Features

  • Automatic schema creation and updates based on models
  • Built in support for java types (Integer, String, Uuid, Boolean) with an API to add your own
  • Support for OneToMany mappings with arraylist columns
  • Out-of-the-box adapters for Sqlite (flat file), Sqlite (Memory) and HiariCP-MariaDB
  • Dynamic SQL Dialects depending on the target platform
  • Incredibly easy to use API

Performance

Tests ran on my main workstation, targeting a Sqlite flatfile and memory database. image

Examples

posts; @Column private UUID minecraftUserId = UUID.randomUUID(); @Column( name = "email", defaultValue = "[email protected]" ) private String emailAddress; } public class SocialPost extends StormModel { @Column( notNull = true ) private String content; @Column( keyType = KeyType.FOREIGN, references = {User.class} ) private Integer poster; } // create an instance Storm storm = new Storm(new SqliteDriver(dataFile)); // register one table storm.migrate(new User()); storm.migrate(new SocialPost()); storm.runMigrations(); // create a new user User mindgamesnl = new User(); mindgamesnl.setUserName("Mindgamesnl"); mindgamesnl.setEmailAddress("[email protected]"); mindgamesnl.setScore(9009); // save or update the user storm.save(mindgamesnl); // query for users Collection justMindgamesnl = storm.buildQuery(User.class) .where("user_name", Where.EQUAL, "Mindgamesnl") .limit(1) .execute() .join();">
// create a model
@Data
@Table(name = "user")
class User extends StormModel {

    @Column
    private String userName;

    @Column
    private Integer score;

    @Column(
            type = ColumnType.ONE_TO_MANY,
            references = {SocialPost.class},
            matchTo = "poster"
    )
    private List<SocialPost> posts;

    @Column
    private UUID minecraftUserId = UUID.randomUUID();

    @Column(
            name = "email",
            defaultValue = "[email protected]"
    )
    private String emailAddress;

}

public class SocialPost extends StormModel {

    @Column(
            notNull = true
    )
    private String content;

    @Column(
            keyType = KeyType.FOREIGN,
            references = {User.class}
    )
    private Integer poster;

}


// create an instance
Storm storm = new Storm(new SqliteDriver(dataFile));
// register one table
storm.migrate(new User());
storm.migrate(new SocialPost());
storm.runMigrations();

// create a new user
User mindgamesnl = new User();
mindgamesnl.setUserName("Mindgamesnl");
mindgamesnl.setEmailAddress("[email protected]");
mindgamesnl.setScore(9009);

// save or update the user
storm.save(mindgamesnl);

// query for users
Collection<User> justMindgamesnl =
        storm.buildQuery(User.class)
        .where("user_name", Where.EQUAL, "Mindgamesnl")
        .limit(1)
        .execute()
        .join();

Usage with HikariCP

// hikari
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://localhost:3306/simpsons");
config.setUsername("bart");
config.setPassword("51mp50n");
config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");

Storm storm = new Storm(new HikariDriver(config));
You might also like...

Bootique is a minimally opinionated platform for modern runnable Java apps.

Bootique is a minimally opinionated java launcher and integration technology. It is intended for building container-less runnable Java applications. W

Dec 29, 2022

Opinionated libraries for HTTP&JSON-based RPC using Retrofit, Feign, OkHttp as clients and Jetty/Jersey as servers

Conjure Java Runtime (formerly http-remoting) This repository provides an opinionated set of libraries for defining and creating RESTish/RPC servers a

Dec 13, 2022

Mirror of Apache Storm

Master Branch: Storm is a distributed realtime computation system. Similar to how Hadoop provides a set of general primitives for doing batch processi

Dec 26, 2022

Mirror of Apache Storm

Master Branch: Storm is a distributed realtime computation system. Similar to how Hadoop provides a set of general primitives for doing batch processi

Jan 3, 2023

A scalable, mature and versatile web crawler based on Apache Storm

A scalable, mature and versatile web crawler based on Apache Storm

StormCrawler is an open source collection of resources for building low-latency, scalable web crawlers on Apache Storm. It is provided under Apache Li

Jan 2, 2023

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Dec 30, 2022

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan 1, 2023

Simple, fast Key-Value storage. Inspired by HaloDB

Phantom Introduction Phantom is an embedded key-value store, provides extreme high write throughput while maintains low latency data access. Phantom w

Apr 14, 2022

Easy-es - easy use for elastich search

Easy-es - easy use for elastich search

Born To Simplify Development What is Easy-Es? Easy-Es is a powerfully enhanced toolkit of RestHighLevelClient for simplify development. This toolkit p

Jan 6, 2023

sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters.

sql2o Sql2o is a small java library, with the purpose of making database interaction easy. When fetching data from the database, the ResultSet will au

Dec 28, 2022

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

Check out ObjectBox Check out our new mobile database ObjectBox (GitHub repo). ObjectBox is a superfast object-oriented database with strong relation

Jan 5, 2023

A simple-to-use storage ORM supporting several databases for Java.

Storage Handler This is a library based off of my old storage handler within my queue revamp. It's for easy storage handling for multiple platforms. N

Jun 22, 2022

Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.

Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.

Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.

Jan 4, 2023

A Java library that implements a ByteChannel interface over SSLEngine, enabling easy-to-use (socket-like) TLS for Java applications.

TLS Channel TLS Channel is a library that implements a ByteChannel interface over a TLS (Transport Layer Security) connection. It delegates all crypto

Dec 31, 2022

Fast Android Development. Easy maintainance.

Fast Android Development. Easy maintenance. AndroidAnnotations is an Open Source framework that speeds up Android development. It takes care of the pl

Dec 31, 2022

A simple Plugin to allow server admins and user with Permissions to change fast and easy thier own Gamemode

A simple Plugin to allow server admins and user with Permissions to change fast and easy thier own Gamemode

A simple Plugin to allow server admins and user with Permissions to change fast and easy thier own Gamemode

Jan 17, 2022

Arbitrary test data generator for parameterized tests in Java inspired by AutoFixture.

AutoParams AutoParams is an arbitrary test data generator for parameterized tests in Java inspired by AutoFixture. Sometimes setting all the test data

Jan 2, 2023

A 3D graphics engine created in Java. The project was inspired by javidx9's series on YouTube.

3D Graphics Engine A 3D graphics engine created in Java. The project was inspired by javidx9's series on YouTube. Installation Clone this repository o

Sep 16, 2022

a reverse proxy load balancer using Java. Inspired by Nginx.

a reverse proxy load balancer using Java. Inspired by Nginx.

Project Outline: Project Main coding reverse proxy support configuration adding unit test works on Websocket Stress Test compared to Nginx load balanc

Aug 5, 2022
Comments
  • Connection leak

    Connection leak

    As soon as I create 5 or more models, it will say that the connection is not available. It will cause this error: https://haste.jazzkuh.com/utarurosij.apache, if I remove a random model, it will work again.

    I thought that something might not be properly closed in the runMigrations method since it instantly errors if I have 6 or more models, if I have 5 it will give the error when I try to use the database, but it doesn't when I don't run the method.

    My init method: https://haste.jazzkuh.com/uyepamurif.java

    Models:

    • https://haste.jazzkuh.com/ugubijizob.kotlin
    • https://haste.jazzkuh.com/ijemufipos.less
    • https://haste.jazzkuh.com/fagevojogo.less
    • https://haste.jazzkuh.com/odawupaman.less
    • https://haste.jazzkuh.com/peceruqaqo.less
    • https://haste.jazzkuh.com/baqinituxo.typescript
    opened by Esmaay 7
  • Booleans

    Booleans

    For me, when I tried using booleans with storm they never seemed to work correctly. After my fix, it all seemed to work as intended. Idk if it was somehow my fault it didn't work but just putting this out there :D

    opened by Jazzkuh 0
Releases(prod125)
Owner
Mats
Student by day and night, engineer, actually, also by night! turns out to be quite the problem
Mats
greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

Check out ObjectBox Check out our new mobile database ObjectBox (GitHub repo). ObjectBox is a superfast object-oriented database with strong relation

Markus Junginger 12.6k Jan 5, 2023
ObjectiveSQL is an ORM framework in Java based on ActiveRecord pattern

ObjectiveSQL is an ORM framework in Java based on ActiveRecord pattern, which encourages rapid development and clean, codes with the least, and convention over configuration.

Braisdom 1.2k Dec 28, 2022
ORM16 is a library exploring code generation-based approach to ORM for Java 17 and focusing on records as persistent data model

About ORM16 ORM16 is a library exploring code generation-based approach to ORM for Java 17 and focusing on records as persistent data model. Example I

Ivan Gammel 1 Mar 30, 2022
Ebean ORM

Ebean ORM

Ebean ORM 1.3k Jan 5, 2023
DAO oriented database mapping framework for Java 8+

Doma Doma 2 is a database access framework for Java 8+. Doma has various strengths: Verifies and generates source code at compile time using annotatio

domaframework 353 Dec 28, 2022
MyBatis SQL mapper framework for Java

MyBatis SQL Mapper Framework for Java The MyBatis SQL mapper framework makes it easier to use a relational database with object-oriented applications.

MyBatis 18k Jan 2, 2023
Language-Natural Persistence Layer for Java

Permazen is a better persistence layer for Java Persistence is central to most applications. But there are many challenges involved in persistence pro

Permazen 322 Dec 12, 2022
Fast and Easy mapping from database and csv to POJO. A java micro ORM, lightweight alternative to iBatis and Hibernate. Fast Csv Parser and Csv Mapper

Simple Flat Mapper Release Notes Getting Started Docs Building it The build is using Maven. git clone https://github.com/arnaudroger/SimpleFlatMapper.

Arnaud Roger 418 Dec 17, 2022
🐀 Simple, Fast and easy to implement ORM for most popular databases

RatORM Simple, Fast and easy to implement ORM for most popular databases Status: Branch Tests Code Quality master Usefull links Helpful links: GitHub

Szczurowsky 3 Dec 25, 2022
A distributed lock that supports the use of Redis and Zookeeper, out of the box, fast and easy to use

lock-spring-boot-starter A distributed lock that supports the use of Redis and Zookeeper, out of the box, fast and easy to use 一款基于 Redis 和 Zookeeper

Pear Stack 9 Oct 15, 2022