org.qi4j.entitystore.sql

## Class SQLEntityStoreMixin

- java.lang.Object
- - org.qi4j.entitystore.sql.SQLEntityStoreMixin

- All Implemented Interfaces:
    ServiceActivation, EntityStore, EntityStoreSPI, StateStore

      public class SQLEntityStoreMixin
      extends Object
      implements EntityStore, EntityStoreSPI, StateStore, ServiceActivation

  SQL EntityStore core Mixin.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.qi4j.api.service.ServiceActivation

      `ServiceActivation.ServiceActivator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SQLEntityStoreMixin()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateService()` Called after ServiceComposite Activation.
    `StateCommitter` | `applyChanges(EntityStoreUnitOfWork unitofwork, Iterable<EntityState> states)`
    `EntityState` | `entityStateOf(EntityStoreUnitOfWork unitOfWork, ModuleSpi module, EntityReference entityRef)`
    `Input<EntityState,EntityStoreException>` | `entityStates(ModuleSpi module)`
    `protected DatabaseSQLService.EntityValueResult` | `getValue(EntityReference ref)`
    `JSONObject` | `jsonStateOf(String id)`
    `EntityState` | `newEntityState(EntityStoreUnitOfWork unitOfWork, ModuleSpi module, EntityReference entityRef, EntityDescriptor entityDescriptor)`
    `EntityStoreUnitOfWork` | `newUnitOfWork(Usecase usecase, ModuleSpi module, long currentTime)`
    `protected String` | `newUnitOfWorkId()`
    `void` | `passivateService()` Called before ServiceComposite Passivation.
    `protected DefaultEntityState` | `readEntityState(ModuleSpi module, Reader entityState)`
    `protected void` | `writeEntityState(DefaultEntityState state, Writer writer, String version)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SQLEntityStoreMixin

          public SQLEntityStoreMixin()

  - ### Method Detail

    - #### activateService

          public void activateService()
                               throws Exception

      Description copied from interface: `ServiceActivation`
      Called after ServiceComposite Activation.
      Specified by:
        `activateService` in interface `ServiceActivation`
      Throws:
        `Exception`

    - #### passivateService

          public void passivateService()
                                throws Exception

      Description copied from interface: `ServiceActivation`
      Called before ServiceComposite Passivation.
      Specified by:
        `passivateService` in interface `ServiceActivation`
      Throws:
        `Exception`

    - #### applyChanges

          public StateCommitter applyChanges(EntityStoreUnitOfWork unitofwork,
                                    Iterable<EntityState> states)

      Specified by:
        `applyChanges` in interface `EntityStoreSPI`

    - #### entityStateOf

          public EntityState entityStateOf(EntityStoreUnitOfWork unitOfWork,
                                  ModuleSpi module,
                                  EntityReference entityRef)

      Specified by:
        `entityStateOf` in interface `EntityStoreSPI`

    - #### newEntityState

          public EntityState newEntityState(EntityStoreUnitOfWork unitOfWork,
                                   ModuleSpi module,
                                   EntityReference entityRef,
                                   EntityDescriptor entityDescriptor)

      Specified by:
        `newEntityState` in interface `EntityStoreSPI`

    - #### newUnitOfWork

          public EntityStoreUnitOfWork newUnitOfWork(Usecase usecase,
                                            ModuleSpi module,
                                            long currentTime)

      Specified by:
        `newUnitOfWork` in interface `EntityStore`

    - #### entityStates

          public Input<EntityState,EntityStoreException> entityStates(ModuleSpi module)

      Specified by:
        `entityStates` in interface `EntityStore`

    - #### newUnitOfWorkId

          protected String newUnitOfWorkId()

    - #### readEntityState

          protected DefaultEntityState readEntityState(ModuleSpi module,
                                           Reader entityState)
                                                throws EntityStoreException

      Throws:
        `EntityStoreException`

    - #### jsonStateOf

          public JSONObject jsonStateOf(String id)
                                 throws IOException

      Specified by:
        `jsonStateOf` in interface `StateStore`
      Throws:
        `IOException`

    - #### getValue

          protected DatabaseSQLService.EntityValueResult getValue(EntityReference ref)

    - #### writeEntityState

          protected void writeEntityState(DefaultEntityState state,
                              Writer writer,
                              String version)
                                   throws EntityStoreException

      Throws:
        `EntityStoreException`