Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

129 Commits

Repository files navigation



JWS Object Relational Mapping

Introduction

When it came to using an ORM Lib in java I used ORMLite before. It worked quite well, but I didn't like the query builder.

Another thing was that I wanted to have control over the JDBC Wrapper to have a simple way of implementing an auto-reconnect function, if it gets disconnected for some reason.

I finally decided to make an own ORM that fits my needs and here it is.

Documentation

Docs for version 2 will follow as soon as version 2 is fully stable.

Example usage

Model

@Dates@SoftDeleteclassUserextendsModel {
@Columnintid;
@ColumnStringname;
@ColumnTimestampcreatedAt;
@ColumnTimestampupdatedAt;
@ColumnTimestampdeletedAt;
}

Usage

//Create connection, initialize reposSQLsql = newMySQL("localhost",3306,"mydb","myuser","changeme1234");
ORMConfigconfig = newORMConfig().setDefaultSize(255); //optionalRepo<User> repo = ORM.register(User.class, sql, config);
//Create the table if it doesn't exist (optional)repo.migrate();
//Print all usernamesfor(Useruser : Repo.get(User.class).all()){
System.out.println(user.name);
}

Maven

Repository

<repository>
<id>javawebstack</id>
<url>https://repo.javawebstack.org</url>
</repository>

Dependency

<dependency>
<groupId>org.javawebstack</groupId>
<artifactId>ORM</artifactId>
<version>1.0-SNAPSHOT<!-- VERSION --></version>
</dependency>

or Jitpack

<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.JavaWebStack</groupId>
<artifactId>ORM</artifactId>
<version>COMMIT_HASH</version>
</dependency>

Driver

You also need to add the driver you want to use. JavaWebStack ORM comes with a wrapper for com.mysql.jdbc.Driver, but you can also create an own wrapper implementing the interface SQL.

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.22</version>
<scope>compile</scope>
</dependency>

About

Object Relational Mapping Framework of JavaWebStack (former AJORM)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages