Giter VIP home page Giter VIP logo

weightless-orm's Introduction

Weightless is the lowest barrier-to-entry database mapping library for the JVM. Weightless currently supports MongoDB. Learn more at weightlessorm.com.

Github Code Maven Central Travis CI Build Status Codacy Badge CodeFactor Code Quality LGTM Code Quality codecov Gitter

Getting Started

Suppose we have a Person object we want to store in a Mongo database.

class Person {
  String name;
  int age;
}

With the Weightless library, the next class we will create is a PersonAccess interface. Note the method level and parameter level annotations.

interface PersonAccess {
  @Create
  void create(Person person);
  
  @Find
  Person findByName(@Field("name") @Equals String name);
}

Wait! We never have to implement this interface! Weightless has enough information to implement this class for us at runtime.

Weightless weightless = Weightless.mongo("mongodb://localhost:27017").database("mydatabase").build(); // Connect to a local MongoDB instance
PersonAccess personAccess = weightless.get(PersonAccess.class); // PersonAccess is implemented for us here

Person james = new Person("James", 30);
personAccess.create(james);

personAccess.findByName("James"); // { "name": "James", "age": 30 }

Installation

Install with maven:

<dependency>
  <groupId>com.jackhallam</groupId>
  <artifactId>weightless-orm</artifactId>
  <version>0.1.1-beta</version>
</dependency>

Is Weightless for Me?

Is Weightless a good fit for your project? Weightless is designed to help projects get connected to a database as quickly as possible. Weightless is highly opinionated; it gives developers fewer customization options, and in return it is extremely easy to use.

That being said, Weightless does not lock you in. Off-boarding when your project is mature enough to need a highly customized solution is very simple. You can still use the same database, and you can move one database table or collection away from Weightless' control at a time as needed.

Going Further

Visit weightlessorm.com for a more information with live examples.

weightless-orm's People

Contributors

jackhallam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

gitter-badger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.