Class PositionEntity

java.lang.Object
edu.yu.marketmaker.persistence.PositionEntity
All Implemented Interfaces:
IdentifiableEntity<String>

@Entity public class PositionEntity extends Object implements IdentifiableEntity<String>
Entity used by hazelcast
  • Constructor Details

    • PositionEntity

      public PositionEntity()
      No-args constructor required by JPA.
    • PositionEntity

      public PositionEntity(String symbol, int netQuantity, long version, UUID lastFillId)
      All-args constructor.
  • Method Details

    • getId

      public String getId()
      Description copied from interface: IdentifiableEntity
      Returns the unique identifier for this entity.
      Specified by:
      getId in interface IdentifiableEntity<String>
      Returns:
      the unique key
    • toRecord

      public Position toRecord()
      Converts this JPA entity back into the immutable Position record used by the application.
      Returns:
      A Position record.
    • fromRecord

      public static PositionEntity fromRecord(Position position)
      Static helper to create an Entity from a Record. Useful for the MapStore.store() method.
      Parameters:
      position - The position record.
      Returns:
      A new PositionEntity.
    • getSymbol

      public String getSymbol()
    • setSymbol

      public void setSymbol(String symbol)
    • getNetQuantity

      public int getNetQuantity()
    • setNetQuantity

      public void setNetQuantity(int netQuantity)
    • getVersion

      public long getVersion()
    • setVersion

      public void setVersion(long version)
    • getLastFillId

      public UUID getLastFillId()
    • setLastFillId

      public void setLastFillId(UUID lastFillId)
    • toString

      public String toString()
      Overrides:
      toString in class Object