⚙️
T-MiniGameAPI
WebsiteDiscord
1.4.0
1.4.0
  • 🏠Home
  • 💻Maven and Gradle
  • 📦Minigame setup
  • 🖱️Plugins are using this libarary
  • Basic features
    • 🗺️Configuration
      • 🎯Configurators
      • 🔴Override Configuartors
    • 🖱️Commands
      • 🧔Parent commands
      • 🧒Sub commands
      • 📑Tab completer
      • ®️Command registration
    • 🧑Models
      • 📦File model
        • 🟢Single file
        • 🟠Many files
      • 💡DB model
      • 🧑‍🦱Users
    • 📔Loaders
      • 📗Loader
        • 📂File loader
        • 💾Database loader
    • 💬Library commands
  • Minigame features
    • 🅰️Arena system
      • 🟢Arena
      • 🔵ArenaManager
    • 🎮Game system
      • 🔴Game Manager
      • 🔵Game State
      • 🟡Users in game
      • 🟢Teams
    • ⏰Timers
      • 😀SimpleTimer
      • ✨XpTimer
    • 🪙Coins system
      • 🟢UserCoins
      • 🔵UserCoinsManager
    • ✨Statistics system
      • 🟢Default statistics system
      • 🔵Your own statistics system
    • 💥Cosmetics system
      • 📀Cosmetic
        • 💕ParticleCosmetic
      • ✳️Cosmetics Manager
      • 🧒Users' cosmetics
        • 💿UserCosmeticsManager
        • ✅UserCosmetics
  • Addons
    • 🎁What is addon?
    • 🖍️How to create addon?
    • 📃Addons list
Powered by GitBook
On this page
  1. Basic features
  2. Models

DB model

Every database model must extend AbstractDbModel.

A class must have a field that is annotated by Id annotation

Define your table name in geTableName method.

The table name must be defined without a table prefix.

In every constructor must be called init method.

Example of the implementation of DbModel.

@Table(name = "users") //or override getTableName()
public class MyUser extends AbstractDbModel implements User {

    @Id
    private final UUID uuid;
    private double coins;
    
    public static final String TABLE_NAME = "users";

    public UserCoinsImpl(UUID uuid, double coins) {
        this.uuid = uuid;
        this.coins = coins;
        init();
    }
    
    //getters and setters
    
    //You can use @Table annotation insted of this
    @Override
    public String getTableName() {
        return TABLE_NAME;
    }
}
PreviousMany filesNextUsers

Last updated 1 year ago

🧑
💡