PersistentState
Keywords: net.corda.core.schemas.PersistentState class
Date: 2023-09-18

net.corda.core.schemas

## Class PersistentState

- net.corda.core.schemas.PersistentState

- All Implemented Interfaces:
    DirectStatePersistable, StatePersistable
  Direct Known Subclasses:
    CommonSchemaV1.FungibleState, CommonSchemaV1.LinearState, SampleCashSchemaV1.PersistentCashState, CashSchemaV1.PersistentCashState, SampleCashSchemaV3.PersistentCashState, CommercialPaperSchemaV1.PersistentCommercialPaperState

      @MappedSuperclass
      public class PersistentState
      implements DirectStatePersistable

  A super class for all mapped states exported to a schema that ensures the `class StateRef` appears on the database row. The `class StateRef` will be set to the correct value by the framework (there's no need to set during mapping generation by the state itself).

  See Also:
    `class StateRef`, `class StateRef`

- - ### Constructor Detail

    - #### PersistentState

          public PersistentState(@Nullable
                                 PersistentStateRef stateRef)

      A super class for all mapped states exported to a schema that ensures the `class StateRef` appears on the database row. The `class StateRef` will be set to the correct value by the framework (there's no need to set during mapping generation by the state itself).

      See Also:
        `class StateRef`, `class StateRef`

    - #### PersistentState

          public PersistentState()

      A super class for all mapped states exported to a schema that ensures the `class StateRef` appears on the database row. The `class StateRef` will be set to the correct value by the framework (there's no need to set during mapping generation by the state itself).

      See Also:
        `class StateRef`, `class StateRef`

  - ### Method Detail

    - #### getStateRef

          @Nullable
          public PersistentStateRef getStateRef()

    - #### setStateRef

          public void setStateRef(@Nullable
                                  PersistentStateRef p)