Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kazuki43zoo/mybatis-graalvm-demo

Demo application for MyBatis + PostgreSQL on GraalVM
https://github.com/kazuki43zoo/mybatis-graalvm-demo

Last synced: about 1 month ago
JSON representation

Demo application for MyBatis + PostgreSQL on GraalVM

Awesome Lists containing this project

README

        

# mybatis-graalvm-demo

This project is demo application using MyBatis + PostgreSQL on GraalVM.

## Requirements

* Installed the Docker
* Installed the JDK 8+

## Versions

* MyBatis 3.5.1 (Some class override to support GraalVM at temporary)
* PostgreSQL 11.3
* GraalVM 19.0.0

## How to build and star container

```
$ ./docker-build.sh
...
Successfully built a31b6097719d
Successfully tagged mybatis-graalvm-demo:latest
8ae2757caa98ef44002bab0d9e35dc6c847ebb9719236429c21c31f80ee91330
root@8ae2757caa98:/#
```

## How to run the demo application

```
root@8ae2757caa98:/# ./mybatis-graalvm-demo
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
2019-06-03T17:17:50.575: initialize configuration...
2019-06-03T17:17:51.927: initialize data source...
drop table if exists city

create table city (
id int primary key generated by default as identity,
name varchar not null,
state varchar,
country varchar
)

insert into city (name, state, country) values ('San Francisco', 'CA', 'US')

commit

2019-06-03T17:17:51.957: building sql session factory...
2019-06-03T17:17:51.957: open new session...
Opening JDBC Connection
Setting autocommit to false on JDBC Connection [org.postgresql.jdbc.PgConnection@7f241fc52d18]
==> Preparing: INSERT INTO city (name, state, country) VALUES(?, ?, ?)
==> Parameters:
<== Updates: 1
==> Preparing: select id, name, state, country from city where id = ?
==> Parameters:
<== Columns: id, name, state, country
<== Row: 2, Toshima-ku, Tokyo, JP
<== Total: 1
2,Toshima-ku,Tokyo,JP
2019-06-03T17:17:51.972: commit session...
Committing JDBC Connection [org.postgresql.jdbc.PgConnection@7f241fc52d18]
Resetting autocommit to true on JDBC Connection [org.postgresql.jdbc.PgConnection@7f241fc52d18]
Closing JDBC Connection [org.postgresql.jdbc.PgConnection@7f241fc52d18]
root@8ae2757caa98:/#
```

## Project Structure

```
.
├── Dockerfile
├── README.md
├── docker-build.sh
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
├── main
│   ├── java
│   │   ├── com
│   │   │   └── example
│   │   │   ├── Application.java
│   │   │   ├── domain
│   │   │   │   └── City.java
│   │   │   └── mapper
│   │   │   └── CityMapper.java
│   │   └── org
│   │   └── apache
│   │   └── ibatis
│   │   ├── binding
│   │   │   └── MapperProxy.java
│   │   ├── builder
│   │   │   └── annotation
│   │   │   └── MapperAnnotationBuilder.java
│   │   ├── reflection
│   │   │   └── SystemMetaObject.java
│   │   └── session
│   │   └── Configuration.java
│   └── resources
│   ├── META-INF
│   │   └── native-image
│   │   ├── dynamic-proxy-config.json
│   │   ├── mybatis-reflection-config.json
│   │   ├── native-image.properties
│   │   ├── reflection-config.json
│   │   └── resource-config.json
│   ├── com
│   │   └── example
│   │   └── mapper
│   │   └── CityMapper.xml
│   ├── initDb.sql
│   └── mybatis-config.xml
└── test
└── java

```