GithubHelp home page GithubHelp logo

fredge / doma Goto Github PK

View Code? Open in Web Editor NEW

This project forked from domaframework/doma

0.0 3.0 0.0 18.89 MB

DAO oriented database mapping framework for Java 8+

Home Page: https://doma.readthedocs.io/

License: Apache License 2.0

Shell 0.02% Java 99.98%

doma's Introduction

Doma Build Status Maven Central

Join the chat at https://gitter.im/domaframework/doma

Doma is a database access framework for Java. Doma uses Pluggable Annotation Processing API to generate source code and validate sql mappings at compile time.

Example

Define an entity class:

@Entity
public class Employee {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @SequenceGenerator(sequence = "EMPLOYEE_SEQ")
    public Integer id;
    public String name;
    public Integer age;
    @Version
    public Integer version;
}

Define a DAO interface:

@Dao(config = AppConfig.class)
public interface EmployeeDao {
    @Select
    Employee selectById(Integer id);
    @Update
    int update(Employee employee);
}

Execute queries:

public class App {
    public static void main(String[] args) {
        TransactionManager tm = AppConfig.singleton().getTransactionManager();
        tm.required(() -> {
            EmployeeDao dao = new EmployeeDaoImpl();
            Employee employee = dao.selectById(1);
            employee.age++;
            dao.update(employee);
        });
    }
}

Documentation

https://doma.readthedocs.io/

Major versions

Status and Repository

Version Status Repository Branch
Doma 1 stable https://github.com/seasarorg/doma/ master
Doma 2 stable https://github.com/domaframework/doma/ master

Compatibility matrix

Doma 1 Doma 2
Java 6 v
Java 7 v
Java 8 v v
Java 9 v
Java 10 v
Java 11 v

License

Copyright 2019 domaframework.org

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

doma's People

Contributors

babywkb avatar backpaper0 avatar bakenezumi avatar bufferings avatar chibat avatar gitter-badger avatar gloryof avatar kakusuke avatar making avatar makotok avatar makotokinoshita avatar matsumana avatar msysyamamoto avatar nakamura-to avatar odashinsuke avatar pinzolo avatar raimon49 avatar tasuku-s avatar tq-jappy avatar zyyxwada avatar

Watchers

 avatar  avatar  avatar

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.