Class SQLHomesRepository

java.lang.Object
com.zetaplugins.essentialz.storage.repositories.Repository
com.zetaplugins.essentialz.storage.repositories.homes.SQLHomesRepository
All Implemented Interfaces:
HomesRepository
Direct Known Subclasses:
MySQLHomesRepository, SQLiteHomesRepository

public abstract class SQLHomesRepository extends Repository implements HomesRepository
  • Constructor Details

  • Method Details

    • initializeTable

      public void initializeTable()
      Description copied from class: Repository
      Initializes the database table(s) for the repository.
      Specified by:
      initializeTable in class Repository
    • load

      public HomeData load(UUID owner, String homeName)
      Description copied from interface: HomesRepository
      Gets a hme by its owner and name.
      Specified by:
      load in interface HomesRepository
      Parameters:
      owner - The UUID of the owner.
      homeName - The name of the warp.
      Returns:
      The home object, or null if not found.
    • save

      public void save(HomeData homeData)
      Description copied from interface: HomesRepository
      Saves a warp to the storage system.
      Specified by:
      save in interface HomesRepository
      Parameters:
      homeData - The warp to save.
    • getInserOrReplaceHomeStatement

      protected abstract String getInserOrReplaceHomeStatement()
    • delete

      public boolean delete(UUID owner, String homeName)
      Description copied from interface: HomesRepository
      Deletes a home from the storage system.
      Specified by:
      delete in interface HomesRepository
      Parameters:
      owner - The UUID of the owner.
      homeName - The name of the home to delete.
    • getAllHomes

      public List<HomeData> getAllHomes(UUID owner)
      Description copied from interface: HomesRepository
      Gets a list of all homes for a specific owner.
      Specified by:
      getAllHomes in interface HomesRepository
      Parameters:
      owner - The UUID of the owner.
      Returns:
      A list of all homes
    • getHomeCount

      public int getHomeCount(UUID owner)
      Description copied from interface: HomesRepository
      Gets the count of homes for a specific owner.
      Specified by:
      getHomeCount in interface HomesRepository
      Parameters:
      owner - The UUID of the owner.
      Returns:
      The count of homes