Interface GraphProvider

All Known Implementing Classes:
InMemoryGraphProvider

public interface GraphProvider
Service Provider Interface (SPI) for persisting scientific object graphs.

Implementations of this interface handle the actual storage and retrieval of entities marked with the Persistent annotation.

Since:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    delete(T entity)
    Deletes an entity from the persistent store.
    Returns the unique name of this provider.
    <T> T
    load(Class<T> type, Object id)
    Loads an entity from the persistent store.
    <T> List<T>
    query(Class<T> type, String query)
    Queries the persistent store for entities matching the given criteria.
    <T> void
    save(T entity)
    Saves an entity to the persistent store.
  • Method Details

    • getName

      String getName()
      Returns the unique name of this provider.
      Returns:
      the provider name.
    • save

      <T> void save(T entity)
      Saves an entity to the persistent store.
      Type Parameters:
      T - the type of the entity
      Parameters:
      entity - the entity to save
    • load

      <T> T load(Class<T> type, Object id)
      Loads an entity from the persistent store.
      Type Parameters:
      T - the type of the entity
      Parameters:
      type - the class of the entity
      id - the unique identifier of the entity
      Returns:
      the loaded entity, or null if not found
    • delete

      <T> void delete(T entity)
      Deletes an entity from the persistent store.
      Type Parameters:
      T - the type of the entity
      Parameters:
      entity - the entity to delete
    • query

      <T> List<T> query(Class<T> type, String query)
      Queries the persistent store for entities matching the given criteria.
      Type Parameters:
      T - the type of the entities
      Parameters:
      type - the class of the entities to search for
      query - symbols or criteria for the search (implementation-specific)
      Returns:
      a list of matching entities