Code Monkey home page Code Monkey logo

sqlapi4j's Introduction

sqlapi4j

Introduction

Well known persistence frameworks like Hibernate generally approach the persistence layer from the Java point of view and try to hide the SQL nature of the database. This has repeatedly been a source of programmers' headache, and we think that it is wrong to ignore the technical nature of the database when working with the persistence layer.

With sqlapi4j we approach the problem from the database/SQL point of view. We create a DSL which we want to look and behave like plain SQL and thus follows the principle of least surprise. Our approach is type safe (in contrast to, e. g., Hibernate criteria API) and even null safe, if you use JSR305 annotations and FindBugs.

sqlapi4j-demo

A working example of an application using SQLApi4J with Guice, C3P0 Pooling, Transactions and Dao Pattern.

You should have a look at the demo sourcecode to get a feeling for how to integrate the SQL Api and for how to use it.

sqlapi4j-core

The core DSL of the SQL API. You will use this package to formulate your table descriptions and your queries. Works directly on connections. Look at dao and transaction layers if you do not want to do the connection stuff "by hand".

sqlapi4j-tx

Simple Layer to handle @Transaction annotations and generally to handle Transactional stuff. You will need to provide a DataSource. Most useful in combination with sqlapi4j-dao

sqlapi4j-tx-guice

Guice Module to help with binding the sqlapi4j-tx classes.

sqlapi4j-dao

sqlapi4j-dao offers a bunch of convenience wrappers making the everyday life much easier.

Needs a TransactionTemplate. sqlapi4j-tx provides an implementation of the TransactionTemplate, but it is perfectly fine to use a different transaction-handling instead. For example you could use spring transactions and implement your own (very simple) TransactionTemplate to integrate spring transactions with sqlapi4j-dao.

Also needs an SqlExecutor, which is defined in sqlapi4j-core and depends on the database type (hibernate, h2, oracle etc) you need to talk to.

AbstractDao

The AbstractDao class takes care of connection handling, exception handling, and of transforming the result rows into Java objects.

SingleTableDao

The SingleTableDao class takes the ease of use even further by defining a default table for SQL statements and a default result transformer. Of course, you still have the power of the AbstractDao at hand when you want to deviate from the defaults.

sqlapi4j's People

Contributors

pschwartau avatar christophmewes avatar fossifoo avatar sven-urbanski-freiheit-com avatar dknodel avatar ulle avatar

Watchers

Klas Kalass avatar James Cloos 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.