Package edu.yu.marketmaker.persistence
Class PositionEntity
java.lang.Object
edu.yu.marketmaker.persistence.PositionEntity
- All Implemented Interfaces:
IdentifiableEntity<String>
Entity used by hazelcast
-
Constructor Summary
ConstructorsConstructorDescriptionNo-args constructor required by JPA.PositionEntity(String symbol, int netQuantity, long version, UUID lastFillId) All-args constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic PositionEntityfromRecord(Position position) Static helper to create an Entity from a Record.getId()Returns the unique identifier for this entity.intlongvoidsetLastFillId(UUID lastFillId) voidsetNetQuantity(int netQuantity) voidvoidsetVersion(long version) toRecord()Converts this JPA entity back into the immutable Position record used by the application.toString()
-
Constructor Details
-
PositionEntity
public PositionEntity()No-args constructor required by JPA. -
PositionEntity
All-args constructor.
-
-
Method Details
-
getId
Description copied from interface:IdentifiableEntityReturns the unique identifier for this entity.- Specified by:
getIdin interfaceIdentifiableEntity<String>- Returns:
- the unique key
-
toRecord
Converts this JPA entity back into the immutable Position record used by the application.- Returns:
- A Position record.
-
fromRecord
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
-
setSymbol
-
getNetQuantity
public int getNetQuantity() -
setNetQuantity
public void setNetQuantity(int netQuantity) -
getVersion
public long getVersion() -
setVersion
public void setVersion(long version) -
getLastFillId
-
setLastFillId
-
toString
-