Skip to content

NeyrowZ/mysql-orm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArcadeLabs


Mysql-ORM Project

GitHub downloads GitHub issues
Status CodeFactor Grade


Usage

Gradle

repositories {
    mavenCentral()
}

dependencies {
    compile 'net.neyrowz.orm:mysql-orm:1.0.0'
}

Maven

<dependency>
    <groupId>net.neyrowz.orm</groupId>
    <artifactId>mysql-orm</artifactId>
    <version>1.0.0</version>
</dependency>

Snippets

  • Host: localhost:3306
  • Database: dev
  • Username: neyrowz
  • Password: 12345six
public class PlayerDataManager extends DataManager<UUID, PlayerData> {

    public PlayerDataManager() {
        super("playerData", new Mysql(new Credentials("localhost:3306", "dev", "neyrowz", "")));
    }

    @Override
    public String getId(UUID id) {
        return id.toString(); // Allow you to format the string key saved in the database.
    }
}

Note You can also use credentials from a json file.

new Credentials("localhost:3306", "dev", "neyrowz", "")
                    .fromJson(new File(".../path/credentials.json"));
{
  "host": "localhost:3306",
  "database": "dev",
  "username": "neyrowz",
  "password": "12345six"
}

About

Object-Relational Mapping API for Java

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages