Klasse DisplayRepository

java.lang.Object
de.delinkedde.areashopreborn.persistence.DisplayRepository

public final class DisplayRepository extends Object
Stores persistent estate displays independently from their Bukkit rendering adapter.
  • Konstruktordetails

    • DisplayRepository

      public DisplayRepository(Database database)
      Creates the display repository.
      Parameter:
      database - database connection provider
  • Methodendetails

    • insert

      public void insert(EstateDisplay display) throws SQLException
      Inserts a display while enforcing one display per block position.
      Parameter:
      display - display to insert
      Löst aus:
      SQLException - when the position is occupied or persistence fails
    • findAt

      public Optional<EstateDisplay> findAt(String worldKey, int x, int y, int z) throws SQLException
      Finds the display registered at an exact block position.
      Parameter:
      worldKey - Bukkit world key
      x - block X coordinate
      y - block Y coordinate
      z - block Z coordinate
      Gibt zurück:
      display when registered
      Löst aus:
      SQLException - when the query fails
    • findByRegion

      public List<EstateDisplay> findByRegion(UUID regionId) throws SQLException
      Lists all displays associated with a region.
      Parameter:
      regionId - region identifier
      Gibt zurück:
      registered displays
      Löst aus:
      SQLException - when the query fails
    • countByRegion

      public int countByRegion(UUID regionId) throws SQLException
      Counts displays without materializing their rows.
      Parameter:
      regionId - region identifier
      Gibt zurück:
      registered display count
      Löst aus:
      SQLException - when the query fails
    • findFirstByRegion

      public Optional<EstateDisplay> findFirstByRegion(UUID regionId) throws SQLException
      Finds the stable first display of a region for display-based teleportation.
      Parameter:
      regionId - region identifier
      Gibt zurück:
      first registered display, if present
      Löst aus:
      SQLException - when the query fails
    • findAll

      public List<EstateDisplay> findAll() throws SQLException
      Lists every registered display for startup refresh and integrity checks.
      Gibt zurück:
      all displays
      Löst aus:
      SQLException - when the query fails
    • findAllDetails

      public List<DisplayRepository.DisplayDetails> findAllDetails() throws SQLException
      Loads displays together with their regions and effective listings in one SQL query.

      This is intentionally complete because omitting a display would also omit its synchronous break/interact protection. The join replaces the former two queries per display.

      Gibt zurück:
      immutable display render snapshots
      Löst aus:
      SQLException - when the query fails
    • findAllDetails

      public List<DisplayRepository.DisplayDetails> findAllDetails(int limit) throws SQLException
      Loads at most a bounded number of display snapshots in one joined query.
      Parameter:
      limit - maximum rows returned
      Gibt zurück:
      immutable display render snapshots
      Löst aus:
      SQLException - when the query fails
    • delete

      public boolean delete(UUID displayId) throws SQLException
      Deletes a display by identifier.
      Parameter:
      displayId - display identifier
      Gibt zurück:
      whether a display was deleted
      Löst aus:
      SQLException - when deletion fails