Skip to content

Latest commit

 

History

History
98 lines (91 loc) · 2.63 KB

ProjectHome.md

File metadata and controls

98 lines (91 loc) · 2.63 KB

An Easy Database Management Framework for Java

The Dbist is an easy Java programming framework to manage dababase.
This is truly the easiest way to do database programming.
You may already know about many other ORM Frameworks (Hibernate, mybatis, Active Record ...).
But it is easier than them.

Now, you can see why we must use Dbist instead of them.

Example

"POST" is a DB table.
The DB table has four columns "title", "author", "content", "created_at" and a primary key "id".

column data type
id (PK) VARCHAR
title VARCHAR
author VARCHAR
content CLOB
created_atDATE

And we try to map a class to this table. (access modifier, getter and setter methods,... has been omitted to make it easier to understand.)

class Post {

String id;
String title;
String author;
String content;
Date createdAt;
...
}

The mapping configuration is not needed any more.
How...? It is mapped automatically, because it is enough to be inferred.
Now you can start DB programming right away.

If you want to...

  1. insert a data,
    Post post = new Post();
    
    post.setId("1");
    post.setTitle("Why Dbist?");
    post.setAuthor("Steve, M. Jung");
    post.setContent("Now, you can see why we should use Dbist...");
    post.setCreatedAt(new Date());
    dml.insert(post);
  2. select the data,
    Post post = dml.select(Post.class, "1");
    
  3. update the data,
    post.setContent("Now, you can see why we must use Dbist...");
    
    dml.update(post);
  4. select data list, (0, 10 means pageIndex and pageSize)
    List<Post> list = dml.selectList(Post.class, new Query(0, 10));
    
    for (Post post : list) {
    ......
    }
  5. select some filtered data list, (title contains "Dbist" characters)
    List<Post> list = dml.selectList(Post.class, new Query(0, 10).addFitler("title" "like" "%Dbist%"));
    
    for (Post post : list) {
    ......
    }

It's really easy, isn't it?